diff options
Diffstat (limited to 'Parser')
| -rw-r--r-- | Parser/Python.asdl | 3 | ||||
| -rw-r--r-- | Parser/parser.h | 2 | ||||
| -rw-r--r-- | Parser/token.c | 6 |
3 files changed, 9 insertions, 2 deletions
diff --git a/Parser/Python.asdl b/Parser/Python.asdl index cedf37a..7b2a873 100644 --- a/Parser/Python.asdl +++ b/Parser/Python.asdl @@ -54,6 +54,7 @@ module Python -- BoolOp() can use left & right? expr = BoolOp(boolop op, expr* values) + | NamedExpr(expr target, expr value) | BinOp(expr left, operator op, expr right) | UnaryOp(unaryop op, expr operand) | Lambda(arguments args, expr body) @@ -87,7 +88,7 @@ module Python -- col_offset is the byte offset in the utf8 string the parser uses attributes (int lineno, int col_offset, int? end_lineno, int? end_col_offset) - expr_context = Load | Store | Del | AugLoad | AugStore | Param + expr_context = Load | Store | Del | AugLoad | AugStore | Param | NamedStore slice = Slice(expr? lower, expr? upper, expr? step) | ExtSlice(slice* dims) diff --git a/Parser/parser.h b/Parser/parser.h index 95cd39d..aee1c86 100644 --- a/Parser/parser.h +++ b/Parser/parser.h @@ -7,7 +7,7 @@ extern "C" { /* Parser interface */ -#define MAXSTACK 1500 +#define MAXSTACK 1700 typedef struct { int s_state; /* State in current DFA */ diff --git a/Parser/token.c b/Parser/token.c index 35519aa..d27f98a 100644 --- a/Parser/token.c +++ b/Parser/token.c @@ -59,6 +59,7 @@ const char * const _PyParser_TokenNames[] = { "ATEQUAL", "RARROW", "ELLIPSIS", + "COLONEQUAL", "OP", "<ERRORTOKEN>", "<COMMENT>", @@ -142,6 +143,11 @@ PyToken_TwoChars(int c1, int c2) case '=': return SLASHEQUAL; } break; + case ':': + switch (c2) { + case '=': return COLONEQUAL; + } + break; case '<': switch (c2) { case '<': return LEFTSHIFT; |
