[Python-checkins] python/dist/src/Tools/compiler dumppyc.py, 1.2, 1.3
jhylton@users.sourceforge.net
jhylton at users.sourceforge.net
Thu Oct 20 21:59:28 CEST 2005
- Previous message: [Python-checkins] python/dist/src/Include Python-ast.h, 1.1, 2.1 asdl.h, 1.1, 2.1 ast.h, 1.1, 2.1 code.h, 1.1, 2.1 Python.h, 2.65, 2.66 compile.h, 2.41, 2.42 pyport.h, 2.71, 2.72 pythonrun.h, 2.67, 2.68 symtable.h, 2.13, 2.14
- Next message: [Python-checkins] python/dist/src/Parser Python.asdl, 1.1, 2.1 asdl.py, 1.1, 2.1 asdl_c.py, 1.1, 2.1 spark.py, 1.1, 2.1 .cvsignore, 2.1, 2.2 grammar.mak, 1.4, 1.5 parsetok.c, 2.37, 2.38
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/python/python/dist/src/Tools/compiler
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2121/Tools/compiler
Modified Files:
dumppyc.py
Log Message:
Merge ast-branch to head
This change implements a new bytecode compiler, based on a
transformation of the parse tree to an abstract syntax defined in
Parser/Python.asdl.
The compiler implementation is not complete, but it is in stable
enough shape to run the entire test suite excepting two disabled
tests.
Index: dumppyc.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Tools/compiler/dumppyc.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- dumppyc.py 17 Sep 2001 18:08:20 -0000 1.2
+++ dumppyc.py 20 Oct 2005 19:59:25 -0000 1.3
@@ -28,7 +28,7 @@
if type(obj) == types.CodeType:
walk(obj, match)
-def main(filename, codename=None):
+def load(filename, codename=None):
co = loadCode(filename)
walk(co, codename)
@@ -39,6 +39,9 @@
else:
filename = sys.argv[1]
codename = None
- if filename.endswith('.py') and os.path.exists(filename+"c"):
- filename += "c"
- main(filename, codename)
+ if filename.endswith('.py'):
+ buf = open(filename).read()
+ co = compile(buf, filename, "exec")
+ walk(co)
+ else:
+ load(filename, codename)
- Previous message: [Python-checkins] python/dist/src/Include Python-ast.h, 1.1, 2.1 asdl.h, 1.1, 2.1 ast.h, 1.1, 2.1 code.h, 1.1, 2.1 Python.h, 2.65, 2.66 compile.h, 2.41, 2.42 pyport.h, 2.71, 2.72 pythonrun.h, 2.67, 2.68 symtable.h, 2.13, 2.14
- Next message: [Python-checkins] python/dist/src/Parser Python.asdl, 1.1, 2.1 asdl.py, 1.1, 2.1 asdl_c.py, 1.1, 2.1 spark.py, 1.1, 2.1 .cvsignore, 2.1, 2.2 grammar.mak, 1.4, 1.5 parsetok.c, 2.37, 2.38
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Python-checkins
mailing list