summaryrefslogtreecommitdiffstats
path: root/Grammar
diff options
context:
space:
mode:
authorAnthony Baxter <anthonybaxter@gmail.com>2004-08-31 10:07:13 (GMT)
committerAnthony Baxter <anthonybaxter@gmail.com>2004-08-31 10:07:13 (GMT)
commit1a4ddaecc732c207fa69890db87ac4b47da867b8 (patch)
tree3c0c9c3086bc1c5ac72554e8ce6a03773cdc8770 /Grammar
parent876032e5700f58cec44a357b6d3174be76b40278 (diff)
downloadcpython-1a4ddaecc732c207fa69890db87ac4b47da867b8.zip
cpython-1a4ddaecc732c207fa69890db87ac4b47da867b8.tar.gz
cpython-1a4ddaecc732c207fa69890db87ac4b47da867b8.tar.bz2
SF patch #1007189, multi-line imports, for instance:
"from blah import (foo, bar baz, bongo)"
Diffstat (limited to 'Grammar')
-rw-r--r--Grammar/Grammar6
1 files changed, 5 insertions, 1 deletions
diff --git a/Grammar/Grammar b/Grammar/Grammar
index 8a7eb59..9e4dad8 100644
--- a/Grammar/Grammar
+++ b/Grammar/Grammar
@@ -51,9 +51,13 @@ continue_stmt: 'continue'
return_stmt: 'return' [testlist]
yield_stmt: 'yield' testlist
raise_stmt: 'raise' [test [',' test [',' test]]]
-import_stmt: 'import' dotted_as_name (',' dotted_as_name)* | 'from' dotted_name 'import' ('*' | import_as_name (',' import_as_name)*)
+import_stmt: import_name | import_from
+import_name: 'import' dotted_as_names
+import_from: 'from' dotted_name 'import' ('*' | '(' import_as_names ')' | import_as_names)
import_as_name: NAME [NAME NAME]
dotted_as_name: dotted_name [NAME NAME]
+import_as_names: import_as_name (',' import_as_name)* [',']
+dotted_as_names: dotted_as_name (',' dotted_as_name)*
dotted_name: NAME ('.' NAME)*
global_stmt: 'global' NAME (',' NAME)*
exec_stmt: 'exec' expr ['in' test [',' test]]