summaryrefslogtreecommitdiffstats
path: root/Grammar
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1993-10-18 17:06:59 (GMT)
committerGuido van Rossum <guido@python.org>1993-10-18 17:06:59 (GMT)
commitdb3165e6559c6b83373e7fed9cdf4371552a9a8e (patch)
tree97b057363244668ebec6630553a86ad2206e3fd2 /Grammar
parentcacd9579d48cb1e2acc3536c9701987b118edf8c (diff)
downloadcpython-db3165e6559c6b83373e7fed9cdf4371552a9a8e.zip
cpython-db3165e6559c6b83373e7fed9cdf4371552a9a8e.tar.gz
cpython-db3165e6559c6b83373e7fed9cdf4371552a9a8e.tar.bz2
* bltinmodule.c: removed exec() built-in function.
* Grammar: add exec statement; allow testlist in expr statement. * ceval.c, compile.c, opcode.h: support exec statement; avoid optimizing locals when it is used * fileobject.{c,h}: add getfilename() internal function.
Diffstat (limited to 'Grammar')
-rw-r--r--Grammar/Grammar9
1 files changed, 7 insertions, 2 deletions
diff --git a/Grammar/Grammar b/Grammar/Grammar
index 430b791..1ba6b5c 100644
--- a/Grammar/Grammar
+++ b/Grammar/Grammar
@@ -2,6 +2,10 @@
# Change log:
+# 18-Oct-93:
+# Use testlist instead of exprlist in expr_stmt
+# Add exec statement
+
# 19-May-93:
# Add access statement
@@ -87,8 +91,8 @@ fplist: fpdef (',' fpdef)* [',']
stmt: simple_stmt | compound_stmt
simple_stmt: small_stmt (';' small_stmt)* [';'] NEWLINE
-small_stmt: expr_stmt | print_stmt | del_stmt | pass_stmt | flow_stmt | import_stmt | global_stmt | access_stmt
-expr_stmt: (exprlist '=')* exprlist
+small_stmt: expr_stmt | print_stmt | del_stmt | pass_stmt | flow_stmt | import_stmt | global_stmt | access_stmt | exec_stmt
+expr_stmt: (testlist '=')* testlist
# For assignments, additional restrictions enforced by the interpreter
print_stmt: 'print' (test ',')* [test]
del_stmt: 'del' exprlist
@@ -104,6 +108,7 @@ access_stmt: 'access' ('*' | NAME (',' NAME)*) ':' accesstype (',' accesstype)*
accesstype: NAME+
# accesstype should be ('public' | 'protected' | 'private') ['read'] ['write']
# but can't be because that would create undesirable reserved words!
+exec_stmt: 'exec' expr ['in' expr [',' expr]]
compound_stmt: if_stmt | while_stmt | for_stmt | try_stmt | funcdef | classdef
if_stmt: 'if' test ':' suite ('elif' test ':' suite)* ['else' ':' suite]