Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
6cf1273f
Commit
6cf1273f
authored
Dec 31, 1991
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow trailing comma after fplist; '=' is no longer comparison;
expr/assignment statement now allows testlists.
parent
5fca8a1b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
4 deletions
+11
-4
Grammar/Grammar
Grammar/Grammar
+11
-4
No files found.
Grammar/Grammar
View file @
6cf1273f
# Grammar for Python, version 8
# Grammar for Python, version 10
# Changes since version 9:
# Equality is now only tested with '=='; consequently
# Exprlist replaced by testlist everywhere except after 'for'
# Changes since version 8:
# Trailing commas in formal parameter lists are allowed
# Changes since version 7:
# New syntax to specify base classes (but old syntax retained for now)
...
...
@@ -51,13 +58,13 @@ eval_input: testlist ENDMARKER
funcdef: 'def' NAME parameters ':' suite
parameters: '(' [fplist] ')'
fplist: fpdef (',' fpdef)*
fplist: fpdef (',' fpdef)*
[',']
fpdef: NAME | '(' fplist ')'
stmt: simple_stmt | compound_stmt
simple_stmt: small_stmt (';' small_stmt)* [';'] NEWLINE
small_stmt: expr_stmt | print_stmt | del_stmt | pass_stmt | flow_stmt | import_stmt | global_stmt
expr_stmt: (
exprlist '=')* expr
list
expr_stmt: (
testlist '=')* test
list
# For assignments, additional restrictions enforced by the interpreter
print_stmt: 'print' (test ',')* [test]
del_stmt: 'del' exprlist
...
...
@@ -81,7 +88,7 @@ test: and_test ('or' and_test)*
and_test: not_test ('and' not_test)*
not_test: 'not' not_test | comparison
comparison: expr (comp_op expr)*
comp_op: '<'|'>'|'=
'|'>='|'<='|'<>'|'!='|'=
='|'in'|'not' 'in'|'is'|'is' 'not'
comp_op: '<'|'>'|'=
='|'>='|'<='|'<>'|'!
='|'in'|'not' 'in'|'is'|'is' 'not'
expr: xor_expr ('|' xor_expr)*
xor_expr: and_expr ('^' and_expr)*
and_expr: shift_expr ('&' shift_expr)*
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment