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
4dae2167
Commit
4dae2167
authored
Jan 21, 1991
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed 'dir' statement.
Function call argument is a testlist instead of exprlist.
parent
c83fd373
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
Grammar/Grammar
Grammar/Grammar
+7
-6
No files found.
Grammar/Grammar
View file @
4dae2167
# Grammar for Python, version 3
# Grammar for Python, version 4
# Changes compared to version 3:
# Removed 'dir' statement.
# Function call argument is a testlist instead of exprlist.
# Changes compared to version 2:
# The syntax of Boolean operations is changed to use more
...
...
@@ -11,8 +15,6 @@
# 'import' and 'def' aren't special any more;
# added 'from' NAME option on import clause, and '*' to import all;
# added class definition.
# TO DO:
# replace 'dir' by something more general?
# Start symbols for the grammar:
# single_input is a single interactive statement;
...
...
@@ -32,12 +34,11 @@ fplist: fpdef (',' fpdef)*
fpdef: NAME | '(' fplist ')'
stmt: simple_stmt | compound_stmt
simple_stmt: expr_stmt | print_stmt | pass_stmt | del_stmt |
dir_stmt |
flow_stmt | import_stmt
simple_stmt: expr_stmt | print_stmt | pass_stmt | del_stmt | flow_stmt | import_stmt
expr_stmt: (exprlist '=')* exprlist NEWLINE
# For assignments, additional restrictions enforced by the interpreter
print_stmt: 'print' (test ',')* [test] NEWLINE
del_stmt: 'del' exprlist NEWLINE
dir_stmt: 'dir' [expr] NEWLINE
pass_stmt: 'pass' NEWLINE
flow_stmt: break_stmt | return_stmt | raise_stmt
break_stmt: 'break' NEWLINE
...
...
@@ -61,7 +62,7 @@ expr: term (('+'|'-') term)*
term: factor (('*'|'/'|'%') factor)*
factor: ('+'|'-') factor | atom trailer*
atom: '(' [testlist] ')' | '[' [testlist] ']' | '{' '}' | '`' testlist '`' | NAME | NUMBER | STRING
trailer: '(' [
expr
list] ')' | '[' subscript ']' | '.' NAME
trailer: '(' [
test
list] ')' | '[' subscript ']' | '.' NAME
subscript: expr | [expr] ':' [expr]
exprlist: expr (',' expr)* [',']
testlist: test (',' test)* [',']
...
...
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