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

Side by Side Diff: Grammar/Grammar

Issue 11682: PEP 380 reference implementation for 3.3
Patch Set: Created 7 years, 11 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
« no previous file with comments | « Doc/whatsnew/3.3.rst ('k') | Include/frameobject.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 dictorsetmaker: ( (test ':' test (comp_for | (',' test ':' test)* [','])) | 112 dictorsetmaker: ( (test ':' test (comp_for | (',' test ':' test)* [','])) |
113 (test (comp_for | (',' test)* [','])) ) 113 (test (comp_for | (',' test)* [','])) )
114 114
115 classdef: 'class' NAME ['(' [arglist] ')'] ':' suite 115 classdef: 'class' NAME ['(' [arglist] ')'] ':' suite
116 116
117 arglist: (argument ',')* (argument [','] 117 arglist: (argument ',')* (argument [',']
118 |'*' test (',' argument)* [',' '**' test] 118 |'*' test (',' argument)* [',' '**' test]
119 |'**' test) 119 |'**' test)
120 # The reason that keywords are test nodes instead of NAME is that using NAME 120 # The reason that keywords are test nodes instead of NAME is that using NAME
121 # results in an ambiguity. ast.c makes sure it's a NAME. 121 # results in an ambiguity. ast.c makes sure it's a NAME.
122 argument: test [comp_for] | test '=' test # Really [keyword '='] test 122 argument: (test) [comp_for] | test '=' test # Really [keyword '='] test
123 comp_iter: comp_for | comp_if 123 comp_iter: comp_for | comp_if
124 comp_for: 'for' exprlist 'in' or_test [comp_iter] 124 comp_for: 'for' exprlist 'in' or_test [comp_iter]
125 comp_if: 'if' test_nocond [comp_iter] 125 comp_if: 'if' test_nocond [comp_iter]
126 126
127 # not used in grammar, but may appear in "node" passed from Parser to Compiler 127 # not used in grammar, but may appear in "node" passed from Parser to Compiler
128 encoding_decl: NAME 128 encoding_decl: NAME
129 129
130 yield_expr: 'yield' [testlist] 130 yield_expr: 'yield' [yield_arg]
131 yield_arg: 'from' test | testlist
OLDNEW
« no previous file with comments | « Doc/whatsnew/3.3.rst ('k') | Include/frameobject.h » ('j') | no next file with comments »

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