summaryrefslogtreecommitdiffstats
path: root/Python/compile.c
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2007-02-09 21:28:07 (GMT)
committerGeorg Brandl <georg@python.org>2007-02-09 21:28:07 (GMT)
commit88fc6646d1b97cb3ba6188808e7c016884d44a73 (patch)
tree4cf73aca05a06e89ae71a719c7b2329af51392b8 /Python/compile.c
parent08c47ba0df4ba87cdce34c126e5bdb28f8c6034c (diff)
downloadcpython-88fc6646d1b97cb3ba6188808e7c016884d44a73.zip
cpython-88fc6646d1b97cb3ba6188808e7c016884d44a73.tar.gz
cpython-88fc6646d1b97cb3ba6188808e7c016884d44a73.tar.bz2
* Remove PRINT_ITEM(_TO), PRINT_NEWLINE(_TO) opcodes.
* Fix some docstrings and one Print -> print. * Fix test_{class,code,descrtut,dis,extcall,parser,popen,pkg,subprocess,syntax,traceback}. These were the ones that generated code with a print statement. In most remaining failing tests there's an issue with the soft space.
Diffstat (limited to 'Python/compile.c')
-rw-r--r--Python/compile.c47
1 files changed, 0 insertions, 47 deletions
diff --git a/Python/compile.c b/Python/compile.c
index e3bdaf5..927569a 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -734,14 +734,6 @@ opcode_stack_effect(int opcode, int oparg)
case PRINT_EXPR:
return -1;
- case PRINT_ITEM:
- return -1;
- case PRINT_NEWLINE:
- return 0;
- case PRINT_ITEM_TO:
- return -2;
- case PRINT_NEWLINE_TO:
- return -1;
case INPLACE_LSHIFT:
case INPLACE_RSHIFT:
case INPLACE_AND:
@@ -1626,43 +1618,6 @@ compiler_lambda(struct compiler *c, expr_ty e)
}
static int
-compiler_print(struct compiler *c, stmt_ty s)
-{
- int i, n;
- bool dest;
-
- assert(s->kind == Print_kind);
- n = asdl_seq_LEN(s->v.Print.values);
- dest = false;
- if (s->v.Print.dest) {
- VISIT(c, expr, s->v.Print.dest);
- dest = true;
- }
- for (i = 0; i < n; i++) {
- expr_ty e = (expr_ty)asdl_seq_GET(s->v.Print.values, i);
- if (dest) {
- ADDOP(c, DUP_TOP);
- VISIT(c, expr, e);
- ADDOP(c, ROT_TWO);
- ADDOP(c, PRINT_ITEM_TO);
- }
- else {
- VISIT(c, expr, e);
- ADDOP(c, PRINT_ITEM);
- }
- }
- if (s->v.Print.nl) {
- if (dest)
- ADDOP(c, PRINT_NEWLINE_TO)
- else
- ADDOP(c, PRINT_NEWLINE)
- }
- else if (dest)
- ADDOP(c, POP_TOP);
- return 1;
-}
-
-static int
compiler_if(struct compiler *c, stmt_ty s)
{
basicblock *end, *next;
@@ -2236,8 +2191,6 @@ compiler_visit_stmt(struct compiler *c, stmt_ty s)
break;
case AugAssign_kind:
return compiler_augassign(c, s);
- case Print_kind:
- return compiler_print(c, s);
case For_kind:
return compiler_for(c, s);
case While_kind: