[Python-checkins] python/dist/src/Python newcompile.c, 1.1.2.112, 1.1.2.113
nascheme@users.sourceforge.net
nascheme at users.sourceforge.net
Tue Oct 11 23:37:32 CEST 2005
Update of /cvsroot/python/python/dist/src/Python
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22615/Python
Modified Files:
Tag: ast-branch
newcompile.c
Log Message:
Implement PyNode_Compile() for the AST compiler. Add some minimal tests
for parser.compilest().
Index: newcompile.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/Attic/newcompile.c,v
retrieving revision 1.1.2.112
retrieving revision 1.1.2.113
diff -u -d -r1.1.2.112 -r1.1.2.113
--- newcompile.c 11 Oct 2005 19:18:11 -0000 1.1.2.112
+++ newcompile.c 11 Oct 2005 21:37:28 -0000 1.1.2.113
@@ -474,6 +474,18 @@
return co;
}
+PyCodeObject *
+PyNode_Compile(struct _node *n, const char *filename)
+{
+ PyCodeObject *co;
+ mod_ty mod = PyAST_FromNode(n, NULL, filename);
+ if (!mod)
+ return NULL;
+ co = PyAST_Compile(mod, filename, NULL);
+ free_mod(mod);
+ return co;
+}
+
static void
compiler_free(struct compiler *c)
{
More information about the Python-checkins
mailing list