comparison Python/pythonrun.c @ 36660:3c0b26113df6 legacy-trunk

Generate code to recursively copy an AST into a tree of Python objects. Expose this through compile().
author Martin v. Löwis <martin@v.loewis.de>
date Sun, 26 Feb 2006 19:42:26 +0000
parents 7fdc639bc5b4
children 2ab9270ef19a
comparison
equal deleted inserted replaced
36659:bb48115e6dab 36660:3c0b26113df6
1252 mod_ty mod = PyParser_ASTFromString(str, filename, start, flags, arena); 1252 mod_ty mod = PyParser_ASTFromString(str, filename, start, flags, arena);
1253 if (mod == NULL) { 1253 if (mod == NULL) {
1254 PyArena_Free(arena); 1254 PyArena_Free(arena);
1255 return NULL; 1255 return NULL;
1256 } 1256 }
1257 if (flags->cf_flags & PyCF_ONLY_AST) {
1258 PyObject *result = PyAST_mod2obj(mod);
1259 PyArena_Free(arena);
1260 return result;
1261 }
1257 co = PyAST_Compile(mod, filename, flags, arena); 1262 co = PyAST_Compile(mod, filename, flags, arena);
1258 PyArena_Free(arena); 1263 PyArena_Free(arena);
1259 return (PyObject *)co; 1264 return (PyObject *)co;
1260 } 1265 }
1261 1266