[Python-checkins] python/dist/src/Python newcompile.c,1.1.2.44,1.1.2.45
jhylton@users.sourceforge.net
jhylton@users.sourceforge.net
Fri, 28 Mar 2003 11:19:44 -0800
Update of /cvsroot/python/python/dist/src/Python
In directory sc8-pr-cvs1:/tmp/cvs-serv21396
Modified Files:
Tag: ast-branch
newcompile.c
Log Message:
avoid generating code for function doc strings.
Index: newcompile.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/Attic/newcompile.c,v
retrieving revision 1.1.2.44
retrieving revision 1.1.2.45
diff -C2 -d -r1.1.2.44 -r1.1.2.45
*** newcompile.c 28 Mar 2003 18:39:55 -0000 1.1.2.44
--- newcompile.c 28 Mar 2003 19:19:40 -0000 1.1.2.45
***************
*** 661,664 ****
--- 661,665 ----
PyCodeObject *co;
arguments_ty args = s->v.FunctionDef.args;
+ int i, n;
assert(s->kind == FunctionDef_kind);
***************
*** 668,672 ****
return 0;
c->u->u_argcount = asdl_seq_LEN(s->v.FunctionDef.args->args);
! VISIT_SEQ(c, stmt, s->v.FunctionDef.body);
co = assemble(c);
if (co == NULL)
--- 669,680 ----
return 0;
c->u->u_argcount = asdl_seq_LEN(s->v.FunctionDef.args->args);
! n = asdl_seq_LEN(s->v.FunctionDef.body);
! for (i = 0; i < n; i++) {
! stmt_ty s2 = asdl_seq_GET(s->v.FunctionDef.body, i);
! if (i == 0 && s2->kind == Expr_kind &&
! s2->v.Expr.value->kind == Str_kind)
! continue;
! VISIT(c, stmt, s2);
! }
co = assemble(c);
if (co == NULL)