[pypy-svn] r34872 - pypy/dist/pypy/rlib/parsing/test

cfbolz at codespeak.net cfbolz at codespeak.net
Wed Nov 22 18:53:15 CET 2006


Author: cfbolz
Date: Wed Nov 22 18:53:14 2006
New Revision: 34872

Modified:
   pypy/dist/pypy/rlib/parsing/test/test_ebnfparse.py
Log:
always use an explicit namespace for less confusion


Modified: pypy/dist/pypy/rlib/parsing/test/test_ebnfparse.py
==============================================================================
--- pypy/dist/pypy/rlib/parsing/test/test_ebnfparse.py	(original)
+++ pypy/dist/pypy/rlib/parsing/test/test_ebnfparse.py	Wed Nov 22 18:53:14 2006
@@ -55,7 +55,9 @@
 """)
     parse = make_parse_function(regexs, rules)
     print transformer
-    exec py.code.Source(transformer).compile()
+    ns = {"RPythonVisitor": RPythonVisitor, "Nonterminal": Nonterminal}
+    exec py.code.Source(transformer).compile() in ns
+    ToAST = ns["ToAST"]
     tree = parse("(0 +! 10) *! (999 +! 10) +! 1")
     print transformer
     tree = tree.visit(ToAST())
@@ -127,7 +129,9 @@
     parse = make_parse_function(regexs, rules)
     tree = parse("x * floor + 1")
     print transformer
-    exec py.code.Source(transformer).compile()
+    ns = {"RPythonVisitor": RPythonVisitor, "Nonterminal": Nonterminal}
+    exec py.code.Source(transformer).compile() in ns
+    ToAST = ns["ToAST"]
     tree = tree.visit(ToAST())
     assert tree.children[2].symbol == "NUMBER"
 
@@ -238,7 +242,9 @@
     'tokenizer': '[object Object]',
     'varDecls': ''
 }""")
-    exec py.code.Source(transformer).compile()
+    ns = {"RPythonVisitor": RPythonVisitor, "Nonterminal": Nonterminal}
+    exec py.code.Source(transformer).compile() in ns
+    ToAST = ns["ToAST"]
     print transformer
     t = t.visit(ToAST())
 



More information about the Pypy-commit mailing list