diff options
author | Thomas Wouters <thomas@python.org> | 2006-02-28 22:42:15 +0000 |
---|---|---|
committer | Thomas Wouters <thomas@python.org> | 2006-02-28 22:42:15 +0000 |
commit | 0e2c5f4b9cdba1ba7043c1be353d0c2f0dc3007b (patch) | |
tree | d88f82d097c22e8015aa3fad5c66b65e92bfca04 /Grammar | |
parent | 008204f484599d6fd263ca860d226d009ced7ac2 (diff) | |
download | cpython-0e2c5f4b9cdba1ba7043c1be353d0c2f0dc3007b.tar.gz |
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/Grammar | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Grammar/Grammar b/Grammar/Grammar index 08c8a00846..9f66df648d 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 |