summaryrefslogtreecommitdiffstats
path: root/Grammar
diff options
context:
space:
mode:
authorThomas Wouters <thomas@python.org>2006-02-28 22:42:15 (GMT)
committerThomas Wouters <thomas@python.org>2006-02-28 22:42:15 (GMT)
commit8ae1295c5b6cfef0fc6db5c97fe68a0b40de8331 (patch)
tree9f4e563b80a5748e23c5e15b56502731a12501cc /Grammar
parent6cba25666c278760a9fea024948b8add7d5c4b1a (diff)
downloadcpython-8ae1295c5b6cfef0fc6db5c97fe68a0b40de8331.zip
cpython-8ae1295c5b6cfef0fc6db5c97fe68a0b40de8331.tar.gz
cpython-8ae1295c5b6cfef0fc6db5c97fe68a0b40de8331.tar.bz2
Make 'as' an actual keyword when with's future statement is used. Not
actually necessary for functionality, but good for transition.
Diffstat (limited to 'Grammar')
-rw-r--r--Grammar/Grammar6
1 files changed, 3 insertions, 3 deletions
diff --git a/Grammar/Grammar b/Grammar/Grammar
index 08c8a00..9f66df6 100644
--- a/Grammar/Grammar
+++ b/Grammar/Grammar
@@ -61,8 +61,8 @@ 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_name: NAME [('as' | NAME) NAME]
+dotted_as_name: dotted_name [('as' | NAME) NAME]
import_as_names: import_as_name (',' import_as_name)* [',']
dotted_as_names: dotted_as_name (',' dotted_as_name)*
dotted_name: NAME ('.' NAME)*
@@ -80,7 +80,7 @@ try_stmt: ('try' ':' suite
['finally' ':' suite] |
'finally' ':' suite))
with_stmt: 'with' test [ with_var ] ':' suite
-with_var: NAME expr
+with_var: ('as' | NAME) expr
# NB compile.c makes sure that the default except clause is last
except_clause: 'except' [test [',' test]]
suite: simple_stmt | NEWLINE INDENT stmt+ DEDENT