--- /home/docs/checkouts/readthedocs.org/user_builds/restrictedpython/checkouts/latest/docs/contributing/ast/python3_2.ast
+++ /home/docs/checkouts/readthedocs.org/user_builds/restrictedpython/checkouts/latest/docs/contributing/ast/python3_3.ast
@@ -1,7 +1,7 @@
--- Python 3.2 AST
--- ASDL's four builtin types are identifier, int, string, object
+-- PYTHON 3.3 AST
+-- ASDL's five builtin types are identifier, int, string, bytes, object
-module Python version "3.2"
+module Python version "3.3"
{
mod = Module(stmt* body)
| Interactive(stmt* body)
@@ -32,11 +32,10 @@
| For(expr target, expr iter, stmt* body, stmt* orelse)
| While(expr test, stmt* body, stmt* orelse)
| If(expr test, stmt* body, stmt* orelse)
- | With(expr context_expr, expr? optional_vars, stmt* body)
+ | With(withitem* items, stmt* body)
| Raise(expr? exc, expr? cause)
- | TryExcept(stmt* body, excepthandler* handlers, stmt* orelse)
- | TryFinally(stmt* body, stmt* finalbody)
+ | Try(stmt* body, excepthandler* handlers, stmt* orelse, stmt* finalbody)
| Assert(expr test, expr? msg)
| Import(alias* names)
@@ -67,6 +66,7 @@
| GeneratorExp(expr elt, comprehension* generators)
-- the grammar constrains where yield expressions can occur
| Yield(expr? value)
+ | YieldFrom(expr value)
-- need sequences for compare to distinguish between
-- x < 4 < 3 and (x < 4) < 3
| Compare(expr left, cmpop* ops, expr* comparators)
@@ -77,7 +77,7 @@
expr? kwargs)
| Num(object n) -- a number as a PyObject.
| Str(string s) -- need to specify raw, unicode, etc?
- | Bytes(string s)
+ | Bytes(bytes s)
| Ellipsis
-- other literals? bools?
@@ -137,7 +137,6 @@
comprehension = (expr target, expr iter, expr* ifs)
- -- not sure what to call the first argument for raise and except
excepthandler = ExceptHandler(expr? type, identifier? name, stmt* body)
attributes (int lineno, int col_offset)
@@ -156,4 +155,6 @@
-- import name with optional 'as' alias.
alias = (identifier name, identifier? asname)
+
+ withitem = (expr context_expr, expr? optional_vars)
}