Mercurial > cpython-lru_cache-weakref
diff Python/compile.c @ 120:c9a5fe1660f5 legacy-trunk
Fix bug in input(); add comments to cases in compile().
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Mon, 21 Jan 1991 16:09:22 +0000 |
| parents | a6934380c6e7 |
| children | 853b736a6a9e |
line wrap: on
line diff
--- a/Python/compile.c Mon Jan 21 15:12:35 1991 +0000 +++ b/Python/compile.c Mon Jan 21 16:09:22 1991 +0000 @@ -1680,7 +1680,7 @@ 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 @@ 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: - 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 expr_input: /* Built-in function eval() */ com_addbyte(c, REFUSE_ARGS); com_node(c, CHILD(n, 0)); com_addbyte(c, RETURN_VALUE); break; - case funcdef: + 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: /* 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));
