[pypy-svn] r47974 - pypy/branch/dist-future-fixing/pypy/interpreter/pyparser/data

jacob at codespeak.net jacob at codespeak.net
Thu Oct 25 19:54:21 CEST 2007


Author: jacob
Date: Thu Oct 25 19:54:19 2007
New Revision: 47974

Modified:
   pypy/branch/dist-future-fixing/pypy/interpreter/pyparser/data/Grammar2.5a
Log:
Reverted the 2.5a grammar to what it was before the wild hacking at the Vilnius sprint. This will break some faulty tests.

Modified: pypy/branch/dist-future-fixing/pypy/interpreter/pyparser/data/Grammar2.5a
==============================================================================
--- pypy/branch/dist-future-fixing/pypy/interpreter/pyparser/data/Grammar2.5a	(original)
+++ pypy/branch/dist-future-fixing/pypy/interpreter/pyparser/data/Grammar2.5a	Thu Oct 25 19:54:19 2007
@@ -24,16 +24,10 @@
 #	file_input is a module or sequence of commands read from an input file;
 #	eval_input is the input for the eval() and input() functions.
 # NB: compound_stmt in single_input is followed by extra NEWLINE!
-
-single_input:  NEWLINE | future_import_list [';'] | [future_import_list ';'] simple_stmt | compound_stmt NEWLINE
-file_input: (future_import_list [';'] NEWLINE)* (NEWLINE | stmt)* ENDMARKER
+single_input: NEWLINE | simple_stmt | compound_stmt NEWLINE
+file_input: (NEWLINE | stmt)* ENDMARKER
 eval_input: testlist NEWLINE* ENDMARKER
 
-future_import_list: import_from_future (';' import_from_future)*
-import_from_future: 'from' '__future__' 'import' ('(' future_import_as_names [','] ')' | future_import_as_names)
-future_import_feature: NAME [('as'|NAME) NAME]
-future_import_as_names: future_import_feature (',' future_import_feature)*
-
 decorator: '@' dotted_name [ '(' [arglist] ')' ] NEWLINE
 decorators: decorator+
 funcdef: [decorators] 'def' NAME parameters ':' suite
@@ -69,12 +63,13 @@
 exec_stmt: 'exec' expr ['in' test [',' test]]
 assert_stmt: 'assert' test [',' test]
 
-compound_stmt: if_stmt | while_stmt | for_stmt | try_stmt | funcdef | classdef
+compound_stmt: if_stmt | while_stmt | for_stmt | try_stmt | with_stmt | funcdef | classdef
 if_stmt: 'if' test ':' suite ('elif' test ':' suite)* ['else' ':' suite]
 while_stmt: 'while' test ':' suite ['else' ':' suite]
 for_stmt: 'for' exprlist 'in' testlist ':' suite ['else' ':' suite]
 try_stmt: ('try' ':' suite (except_clause ':' suite)+ #diagram:break
            ['else' ':' suite] | 'try' ':' suite 'finally' ':' suite)
+with_stmt: 'with' test [ 'as' expr ] ':' suite
 # NB compile.c makes sure that the default except clause is last
 except_clause: 'except' [test [',' test]]
 suite: simple_stmt | NEWLINE INDENT stmt+ DEDENT



More information about the Pypy-commit mailing list