From 45aecf451a64fb1ebe5e74d0b00965ac8d99dff6 Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Wed, 15 Mar 2006 04:58:47 +0000 Subject: Checkpoint. 218 tests are okay; 53 are failing. Done so far: - all classes are new-style (but ripping out classobject.[ch] isn't done) - int/int -> float - all exceptions must derive from BaseException - absolute import - 'as' and 'with' are keywords --- Grammar/Grammar | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) (limited to 'Grammar') diff --git a/Grammar/Grammar b/Grammar/Grammar index 9f66df648d..33c37d264e 100644 --- a/Grammar/Grammar +++ b/Grammar/Grammar @@ -7,18 +7,6 @@ # with someone who can; ask around on python-dev for help. Fred # Drake will probably be listening there. -# Commands for Kees Blom's railroad program -#diagram:token NAME -#diagram:token NUMBER -#diagram:token STRING -#diagram:token NEWLINE -#diagram:token ENDMARKER -#diagram:token INDENT -#diagram:output\input python.bla -#diagram:token DEDENT -#diagram:output\textwidth 20.04cm\oddsidemargin 0.0cm\evensidemargin 0.0cm -#diagram:rules - # Start symbols for the grammar: # single_input is a single interactive statement; # file_input is a module or sequence of commands read from an input file; @@ -61,8 +49,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 [('as' | NAME) NAME] -dotted_as_name: dotted_name [('as' | NAME) NAME] +import_as_name: NAME ['as' NAME] +dotted_as_name: dotted_name ['as' 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 +68,7 @@ try_stmt: ('try' ':' suite ['finally' ':' suite] | 'finally' ':' suite)) with_stmt: 'with' test [ with_var ] ':' suite -with_var: ('as' | NAME) expr +with_var: 'as' 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 -- cgit v1.2.1