summaryrefslogtreecommitdiffstats
path: root/Parser
diff options
context:
space:
mode:
Diffstat (limited to 'Parser')
-rw-r--r--Parser/Python.asdl10
-rw-r--r--Parser/tokenizer.c2
2 files changed, 9 insertions, 3 deletions
diff --git a/Parser/Python.asdl b/Parser/Python.asdl
index dbf14e7..2c3fa94 100644
--- a/Parser/Python.asdl
+++ b/Parser/Python.asdl
@@ -10,7 +10,7 @@ module Python version "$Revision$"
| Suite(stmt* body)
stmt = FunctionDef(identifier name, arguments args,
- stmt* body, expr* decorators)
+ stmt* body, expr* decorators, expr? returns)
| ClassDef(identifier name, expr* bases, stmt* body)
| Return(expr? value)
@@ -100,8 +100,12 @@ module Python version "$Revision$"
excepthandler = (expr? type, expr? name, stmt* body, int lineno,
int col_offset)
- arguments = (expr* args, identifier? vararg, expr* kwonlyargs,
- identifier? kwarg, expr* defaults, expr* kw_defaults)
+ arguments = (arg* args, identifier? vararg, expr? varargannotation,
+ arg* kwonlyargs, identifier? kwarg,
+ expr? kwargannotation, expr* defaults,
+ expr* kw_defaults)
+ arg = SimpleArg(identifier arg, expr? annotation)
+ | NestedArgs(arg* args)
-- keyword arguments supplied to call
keyword = (identifier arg, expr value)
diff --git a/Parser/tokenizer.c b/Parser/tokenizer.c
index 947ad9c..4c3c29e 100644
--- a/Parser/tokenizer.c
+++ b/Parser/tokenizer.c
@@ -92,6 +92,7 @@ char *_PyParser_TokenNames[] = {
"DOUBLESLASH",
"DOUBLESLASHEQUAL",
"AT",
+ "RARROW",
/* This table must match the #defines in token.h! */
"OP",
"<ERRORTOKEN>",
@@ -998,6 +999,7 @@ PyToken_TwoChars(int c1, int c2)
case '-':
switch (c2) {
case '=': return MINEQUAL;
+ case '>': return RARROW;
}
break;
case '*':