From a8b991638ed665c57d0f396e52c43c5a99395dfd Mon Sep 17 00:00:00 2001 From: Anthony Baxter Date: Tue, 31 Aug 2004 10:07:13 +0000 Subject: SF patch #1007189, multi-line imports, for instance: "from blah import (foo, bar baz, bongo)" --- Grammar/Grammar | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'Grammar') diff --git a/Grammar/Grammar b/Grammar/Grammar index 8a7eb59243..9e4dad8078 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]] -- cgit v1.2.1