aboutsummaryrefslogtreecommitdiff
path: root/py/lexer.h
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2017-02-17 11:30:14 +1100
committerDamien George <damien.p.george@gmail.com>2017-02-17 11:30:14 +1100
commit773278ec3030ea9ed809c5a248fde2278ce4b557 (patch)
treeb5a7824dee8dbd2b06acaed06116a7e56e6f03d4 /py/lexer.h
parentae436797927c3c9f7ccdc25dd78af3dd279ca7ff (diff)
py/lexer: Simplify handling of line-continuation error.
Previous to this patch there was an explicit check for errors with line continuation (where backslash was not immediately followed by a newline). But this check is not necessary: if there is an error then the remaining logic of the tokeniser will reject the backslash and correctly produce a syntax error.
Diffstat (limited to 'py/lexer.h')
-rw-r--r--py/lexer.h13
1 files changed, 6 insertions, 7 deletions
diff --git a/py/lexer.h b/py/lexer.h
index d40719285..d5382fc6a 100644
--- a/py/lexer.h
+++ b/py/lexer.h
@@ -39,18 +39,17 @@
*/
typedef enum _mp_token_kind_t {
- MP_TOKEN_END, // 0
+ MP_TOKEN_END,
MP_TOKEN_INVALID,
MP_TOKEN_DEDENT_MISMATCH,
MP_TOKEN_LONELY_STRING_OPEN,
- MP_TOKEN_BAD_LINE_CONTINUATION,
- MP_TOKEN_NEWLINE, // 5
- MP_TOKEN_INDENT, // 6
- MP_TOKEN_DEDENT, // 7
+ MP_TOKEN_NEWLINE,
+ MP_TOKEN_INDENT,
+ MP_TOKEN_DEDENT,
- MP_TOKEN_NAME, // 8
+ MP_TOKEN_NAME,
MP_TOKEN_INTEGER,
MP_TOKEN_FLOAT_OR_IMAG,
MP_TOKEN_STRING,
@@ -58,7 +57,7 @@ typedef enum _mp_token_kind_t {
MP_TOKEN_ELLIPSIS,
- MP_TOKEN_KW_FALSE, // 14
+ MP_TOKEN_KW_FALSE,
MP_TOKEN_KW_NONE,
MP_TOKEN_KW_TRUE,
MP_TOKEN_KW___DEBUG__,