summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1991-01-21 16:09:22 (GMT)
committerGuido van Rossum <guido@python.org>1991-01-21 16:09:22 (GMT)
commit4c4177865d81275b339dc4ac3cd510aa4ae5d938 (patch)
tree8853f0f4b125d7cd519f712115e5ddc30e7cc33c /Python
parent86cd6e646e99f38da1992a048c64b464e873d8e8 (diff)
downloadcpython-4c4177865d81275b339dc4ac3cd510aa4ae5d938.zip
cpython-4c4177865d81275b339dc4ac3cd510aa4ae5d938.tar.gz
cpython-4c4177865d81275b339dc4ac3cd510aa4ae5d938.tar.bz2
Fix bug in input(); add comments to cases in compile().
Diffstat (limited to 'Python')
-rw-r--r--Python/compile.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/Python/compile.c b/Python/compile.c
index 87acf39..1256bd5 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -1680,7 +1680,7 @@ compile_node(c, n)
switch (TYPE(n)) {
- case single_input:
+ case single_input: /* One interactive command */
/* NEWLINE | simple_stmt | compound_stmt NEWLINE */
com_addbyte(c, REFUSE_ARGS);
n = CHILD(n, 0);
@@ -1690,31 +1690,30 @@ compile_node(c, n)
com_addbyte(c, RETURN_VALUE);
break;
- case file_input:
+ case file_input: /* A whole file, or built-in function exec() */
com_addbyte(c, REFUSE_ARGS);
com_file_input(c, n);
com_addoparg(c, LOAD_CONST, com_addconst(c, None));
com_addbyte(c, RETURN_VALUE);
break;
- case expr_input:
+ case expr_input: /* Built-in function eval() */
com_addbyte(c, REFUSE_ARGS);
com_node(c, CHILD(n, 0));
- com_addoparg(c, LOAD_CONST, com_addconst(c, None));
com_addbyte(c, RETURN_VALUE);
break;
- case eval_input:
+ case eval_input: /* Built-in function input() */
com_addbyte(c, REFUSE_ARGS);
com_node(c, CHILD(n, 0));
com_addbyte(c, RETURN_VALUE);
break;
- case funcdef:
+ case funcdef: /* A function definition */
compile_funcdef(c, n);
break;
- case classdef:
+ case classdef: /* A class definition */
/* 'class' NAME parameters ['=' baselist] ':' suite */
com_addbyte(c, REFUSE_ARGS);
com_node(c, CHILD(n, NCH(n)-1));