Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(6600)

Side by Side Diff: Grammar/Grammar

Issue 11682: PEP 380 reference implementation for 3.3
Patch Set: Created 7 years, 4 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
OLDNEW
1 # Grammar for Python 1 # Grammar for Python
2 2
3 # Note: Changing the grammar specified in this file will most likely 3 # Note: Changing the grammar specified in this file will most likely
4 # require corresponding changes in the parser module 4 # require corresponding changes in the parser module
5 # (../Modules/parsermodule.c). If you can't make the changes to 5 # (../Modules/parsermodule.c). If you can't make the changes to
6 # that module yourself, please co-ordinate the required changes 6 # that module yourself, please co-ordinate the required changes
7 # with someone who can; ask around on python-dev for help. Fred 7 # with someone who can; ask around on python-dev for help. Fred
8 # Drake <fdrake@acm.org> will probably be listening there. 8 # Drake <fdrake@acm.org> will probably be listening there.
9 9
10 # NOTE WELL: You should also follow all the steps listed in PEP 306, 10 # NOTE WELL: You should also follow all the steps listed in PEP 306,
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 dictorsetmaker: ( (test ':' test (comp_for | (',' test ':' test)* [','])) | 114 dictorsetmaker: ( (test ':' test (comp_for | (',' test ':' test)* [','])) |
115 (test (comp_for | (',' test)* [','])) ) 115 (test (comp_for | (',' test)* [','])) )
116 116
117 classdef: 'class' NAME ['(' [arglist] ')'] ':' suite 117 classdef: 'class' NAME ['(' [arglist] ')'] ':' suite
118 118
119 arglist: (argument ',')* (argument [','] 119 arglist: (argument ',')* (argument [',']
120 |'*' test (',' argument)* [',' '**' test] 120 |'*' test (',' argument)* [',' '**' test]
121 |'**' test) 121 |'**' test)
122 # The reason that keywords are test nodes instead of NAME is that using NAME 122 # The reason that keywords are test nodes instead of NAME is that using NAME
123 # results in an ambiguity. ast.c makes sure it's a NAME. 123 # results in an ambiguity. ast.c makes sure it's a NAME.
124 argument: test [comp_for] | test '=' test # Really [keyword '='] test 124 argument: (test) [comp_for] | test '=' test # Really [keyword '='] test
125 comp_iter: comp_for | comp_if 125 comp_iter: comp_for | comp_if
126 comp_for: 'for' exprlist 'in' or_test [comp_iter] 126 comp_for: 'for' exprlist 'in' or_test [comp_iter]
127 comp_if: 'if' test_nocond [comp_iter] 127 comp_if: 'if' test_nocond [comp_iter]
128 128
129 # not used in grammar, but may appear in "node" passed from Parser to Compiler 129 # not used in grammar, but may appear in "node" passed from Parser to Compiler
130 encoding_decl: NAME 130 encoding_decl: NAME
131 131
132 yield_expr: 'yield' [testlist] 132 yield_expr: 'yield' [yield_arg]
133 yield_arg: 'from' test | testlist
OLDNEW
« no previous file with comments | « Doc/whatsnew/3.3.rst ('k') | Include/frameobject.h » ('j') | Modules/parsermodule.c » ('J')

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+