diff options
author | John R. Lenton <jlenton@gmail.com> | 2014-01-13 00:41:12 +0000 |
---|---|---|
committer | John R. Lenton <jlenton@gmail.com> | 2014-01-13 00:41:12 +0000 |
commit | 13e64f06604c1502317921201bdde33c57161808 (patch) | |
tree | 865c85e4aaa41fc86711010362b7c0b0b4dbf832 /py/lexer.c | |
parent | 813edf63a3e4c0bab3dd5edd4e7295462386c2f3 (diff) | |
parent | 34f813ee29c7191e3de455c3fc9c788496e3b29e (diff) | |
download | micropython-13e64f06604c1502317921201bdde33c57161808.tar.gz micropython-13e64f06604c1502317921201bdde33c57161808.zip |
Merge remote-tracking branch 'upstream/master' into containment
Diffstat (limited to 'py/lexer.c')
-rw-r--r-- | py/lexer.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/py/lexer.c b/py/lexer.c index d4205236c3..f7f9c631f3 100644 --- a/py/lexer.c +++ b/py/lexer.c @@ -299,8 +299,15 @@ static void mp_lexer_next_token_into(mp_lexer_t *lex, mp_token_t *tok, bool firs // backslash (outside string literals) must appear just before a physical newline next_char(lex); if (!is_physical_newline(lex)) { - // TODO SyntaxError - assert(0); + // SyntaxError: unexpected character after line continuation character + tok->src_name = lex->name; + tok->src_line = lex->line; + tok->src_column = lex->column; + tok->kind = MP_TOKEN_BAD_LINE_CONTINUATION; + vstr_reset(&lex->vstr); + tok->str = vstr_str(&lex->vstr); + tok->len = 0; + return; } else { next_char(lex); } |