Author: Raffael Tfirst <[email protected]>
Branch: py3.5-async
Changeset: r85518:618d170d0fa1
Date: 2016-07-02 21:34 +0200
http://bitbucket.org/pypy/pypy/changeset/618d170d0fa1/

Log:    Add async to grammar

diff --git a/pypy/interpreter/pyparser/data/Grammar3.5 
b/pypy/interpreter/pyparser/data/Grammar3.5
--- a/pypy/interpreter/pyparser/data/Grammar3.5
+++ b/pypy/interpreter/pyparser/data/Grammar3.5
@@ -21,10 +21,9 @@
 
 decorator: '@' dotted_name [ '(' [arglist] ')' ] NEWLINE
 decorators: decorator+
-decorated: decorators (classdef | funcdef)
-# | async_funcdef)
+decorated: decorators (classdef | funcdef | async_funcdef)
 
-# async_funcdef: ASYNC funcdef
+async_funcdef: ASYNC funcdef
 funcdef: 'def' NAME parameters ['->' test] ':' suite
 
 parameters: '(' [typedargslist] ')'
@@ -69,9 +68,8 @@
 nonlocal_stmt: 'nonlocal' NAME (',' NAME)*
 assert_stmt: 'assert' test [',' test]
 
-compound_stmt: if_stmt | while_stmt | for_stmt | try_stmt | with_stmt | 
funcdef | classdef | decorated
-# | async_stmt
-# async_stmt: ASYNC (funcdef | with_stmt | for_stmt)
+compound_stmt: if_stmt | while_stmt | for_stmt | try_stmt | with_stmt | 
funcdef | classdef | decorated | async_stmt
+async_stmt: ASYNC (funcdef | with_stmt | for_stmt)
 if_stmt: 'if' test ':' suite ('elif' test ':' suite)* ['else' ':' suite]
 while_stmt: 'while' test ':' suite ['else' ':' suite]
 for_stmt: 'for' exprlist 'in' testlist ':' suite ['else' ':' suite]
@@ -105,9 +103,8 @@
 arith_expr: term (('+'|'-') term)*
 term: factor (('*'|'@'|'/'|'%'|'//') factor)*
 factor: ('+'|'-'|'~') factor | power
-# power: atom_expr ['**' factor]
-power: atom trailer* ['**' factor]
-# atom_expr: [AWAIT] atom trailer*
+power: atom_expr ['**' factor]
+atom_expr: [AWAIT] atom trailer*
 atom: ('(' [yield_expr|testlist_comp] ')' |
        '[' [testlist_comp] ']' |
        '{' [dictorsetmaker] '}' |
@@ -119,8 +116,6 @@
 sliceop: ':' [test]
 exprlist: (expr|star_expr) (',' (expr|star_expr))* [',']
 testlist: test (',' test)* [',']
-#dictorsetmaker: ( (test ':' test (comp_for | (',' test ':' test)* [','])) |
-#                  (test (comp_for | (',' test)* [','])) )
 dictorsetmaker: ( ((test ':' test | '**' expr)
                    (comp_for | (',' (test ':' test | '**' expr))* [','])) |
                   ((test | star_expr)
@@ -128,9 +123,6 @@
 
 classdef: 'class' NAME ['(' [arglist] ')'] ':' suite
 
-#arglist: (argument ',')* (argument [',']
-#                         |'*' test (',' argument)* [',' '**' test] 
-#                         |'**' test)
 arglist: argument (',' argument)*  [',']
 
 # The reason that keywords are test nodes instead of NAME is that using NAME
@@ -142,7 +134,6 @@
 # Illegal combinations and orderings are blocked in ast.c:
 # multiple (test comp_for) arguements are blocked; keyword unpackings
 # that precede iterable unpackings are blocked; etc.
-#argument: test [comp_for] | test '=' test  # Really [keyword '='] test
 argument: ( test [comp_for] |
             test '=' test |
             '**' test |
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to