Skip to content

Commit b9c4783

Browse files
committed
py/lexer: Remove unreachable code in string tokeniser.
1 parent adccafb commit b9c4783

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

py/lexer.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,8 @@ STATIC void mp_lexer_next_token_into(mp_lexer_t *lex, bool first_token) {
430430
vstr_add_char(&lex->vstr, '\\');
431431
} else {
432432
switch (c) {
433-
case MP_LEXER_EOF: break; // TODO a proper error message?
433+
// note: "c" can never be MP_LEXER_EOF because next_char
434+
// always inserts a newline at the end of the input stream
434435
case '\n': c = MP_LEXER_EOF; break; // backslash escape the newline, just ignore it
435436
case '\\': break;
436437
case '\'': break;

0 commit comments

Comments
 (0)