[pypy-svn] r32635 - in pypy/dist/pypy: annotation interpreter/pyparser interpreter/pyparser/data
ac at codespeak.net
ac at codespeak.net
Mon Sep 25 18:06:02 CEST 2006
Author: ac
Date: Mon Sep 25 18:06:02 2006
New Revision: 32635
Modified:
pypy/dist/pypy/annotation/annrpython.py
pypy/dist/pypy/interpreter/pyparser/astbuilder.py
pypy/dist/pypy/interpreter/pyparser/data/Grammar2.5a
pypy/dist/pypy/interpreter/pyparser/symbol.py
Log:
Introduce the 'as' keyword.
Modified: pypy/dist/pypy/annotation/annrpython.py
==============================================================================
--- pypy/dist/pypy/annotation/annrpython.py (original)
+++ pypy/dist/pypy/annotation/annrpython.py Mon Sep 25 18:06:02 2006
@@ -10,7 +10,7 @@
from pypy.objspace.flow.model import c_last_exception, checkgraph
import py
log = py.log.Producer("annrpython")
-py.log.setconsumer("annrpython", ansi_log)
+py.log.setconsumer("annrpython", None)
from pypy.tool.error import format_blocked_annotation_error, format_someobject_error, AnnotatorError
Modified: pypy/dist/pypy/interpreter/pyparser/astbuilder.py
==============================================================================
--- pypy/dist/pypy/interpreter/pyparser/astbuilder.py (original)
+++ pypy/dist/pypy/interpreter/pyparser/astbuilder.py Mon Sep 25 18:06:02 2006
@@ -1687,7 +1687,7 @@
if self.with_enabled:
return
self.with_enabled = True
- self.keywords.update({'with':None, }) # 'as': None})
+ self.keywords.update({'with':None, 'as': None})
def context(self):
return AstBuilderContext(self.rule_stack)
Modified: pypy/dist/pypy/interpreter/pyparser/data/Grammar2.5a
==============================================================================
--- pypy/dist/pypy/interpreter/pyparser/data/Grammar2.5a (original)
+++ pypy/dist/pypy/interpreter/pyparser/data/Grammar2.5a Mon Sep 25 18:06:02 2006
@@ -54,8 +54,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)*
@@ -69,7 +69,7 @@
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 [ NAME expr ] ':' 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
Modified: pypy/dist/pypy/interpreter/pyparser/symbol.py
==============================================================================
--- pypy/dist/pypy/interpreter/pyparser/symbol.py (original)
+++ pypy/dist/pypy/interpreter/pyparser/symbol.py Mon Sep 25 18:06:02 2006
@@ -85,6 +85,7 @@
old_test = 334
or_test = 335
old_lambdef = 336
+with_stmt = 337
# Generate sym_name
More information about the Pypy-commit
mailing list