NAME 'async' (1, 0) (1, 5)
OP '=' (1, 6) (1, 7)
NUMBER '1' (1, 8) (1, 9)
+ """)
+
+ self.check_tokenize("async\\", """\
+ ERRORTOKEN '\\\\' (1, 5) (1, 6)
+ NAME 'async' (1, 0) (1, 5)
""")
self.check_tokenize("a = (async = 1)", """\
/* The current token is 'async'.
Look ahead one token.*/
+ int async_def_prev = tok->async_def;
+ tok->async_def = 2;
+
struct tok_state ahead_tok;
char *ahead_tok_start = NULL, *ahead_tok_end = NULL;
int ahead_tok_kind;
tok->async_def = 1;
return ASYNC;
}
+ else{
+ tok->async_def = async_def_prev;
+ }
}
}
/* Line continuation */
if (c == '\\') {
c = tok_nextc(tok);
+ if (tok->async_def == 2) {
+ tok->done = E_SYNTAX;
+ return ERRORTOKEN;
+ }
if (c != '\n') {
tok->done = E_LINECONT;
tok->cur = tok->inp;