summaryrefslogtreecommitdiffstats
path: root/Grammar
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2006-03-15 04:58:47 (GMT)
committerGuido van Rossum <guido@python.org>2006-03-15 04:58:47 (GMT)
commit45aecf451a64fb1ebe5e74d0b00965ac8d99dff6 (patch)
treea7edcfb45ceafcffde68a3542aeba67089ea81cb /Grammar
parentf3175f6341ae207543a0d2d3be36c457349066e6 (diff)
downloadcpython-45aecf451a64fb1ebe5e74d0b00965ac8d99dff6.zip
cpython-45aecf451a64fb1ebe5e74d0b00965ac8d99dff6.tar.gz
cpython-45aecf451a64fb1ebe5e74d0b00965ac8d99dff6.tar.bz2
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
Diffstat (limited to 'Grammar')
-rw-r--r--Grammar/Grammar18
1 files changed, 3 insertions, 15 deletions
diff --git a/Grammar/Grammar b/Grammar/Grammar
index 9f66df6..33c37d2 100644
--- a/Grammar/Grammar
+++ b/Grammar/Grammar
@@ -7,18 +7,6 @@
# with someone who can; ask around on python-dev for help. Fred
# Drake <fdrake@acm.org> 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