summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1992-04-05 14:24:50 (GMT)
committerGuido van Rossum <guido@python.org>1992-04-05 14:24:50 (GMT)
commit94fb82e461290e8bc1fbef351f272abf3d39026f (patch)
tree7286fa793f678872a285c9cec78d431c1412da11 /Python
parent8dd79cf788d23bb2abdd5a6fd8557431e80cfe43 (diff)
downloadcpython-94fb82e461290e8bc1fbef351f272abf3d39026f.zip
cpython-94fb82e461290e8bc1fbef351f272abf3d39026f.tar.gz
cpython-94fb82e461290e8bc1fbef351f272abf3d39026f.tar.bz2
Only * can be used for varargs argument lists
Diffstat (limited to 'Python')
-rw-r--r--Python/compile.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/Python/compile.c b/Python/compile.c
index c8ce0aa..dd4fe15 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -1,5 +1,5 @@
/***********************************************************
-Copyright 1991 by Stichting Mathematisch Centrum, Amsterdam, The
+Copyright 1991, 1992 by Stichting Mathematisch Centrum, Amsterdam, The
Netherlands.
All Rights Reserved
@@ -1566,7 +1566,11 @@ com_try_stmt(c, n)
int finally_anchor = 0;
int except_anchor = 0;
REQ(n, try_stmt);
- /* 'try' ':' suite (except_clause ':' suite)* ['finally' ':' suite] */
+ /* 'try' ':' suite (except_clause ':' suite)*
+ | 'try' ':' 'finally' ':' suite */
+
+ /* XXX This can be simplified because except and finally can
+ no longer be mixed in a single try statement */
if (NCH(n) > 3 && TYPE(CHILD(n, NCH(n)-3)) != except_clause) {
/* Have a 'finally' clause */
@@ -1958,12 +1962,12 @@ com_arglist(c, n)
int i, nargs, op;
REQ(n, varargslist);
/* varargslist:
- (fpdef ',')* ('+'|'*') NAME | fpdef (',' fpdef)* [','] */
+ (fpdef ',')* '*' NAME | fpdef (',' fpdef)* [','] */
op = UNPACK_ARG;
nargs = (NCH(n) + 1) / 2;
for (i = 0; i < NCH(n); i += 2) {
int t = TYPE(CHILD(n, i));
- if (t == PLUS || t == STAR) {
+ if (t == STAR) {
op = UNPACK_VARARG;
nargs = i/2;
break;