Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(70022)

Side by Side Diff: Parser/Python.asdl

Issue 11682: PEP 380 reference implementation for 3.3
Patch Set: Created 7 years, 5 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
OLDNEW
1 -- ASDL's five builtin types are identifier, int, string, bytes, object 1 -- ASDL's five builtin types are identifier, int, string, bytes, object
2 2
3 module Python 3 module Python
4 { 4 {
5 mod = Module(stmt* body) 5 mod = Module(stmt* body)
6 | Interactive(stmt* body) 6 | Interactive(stmt* body)
7 | Expression(expr body) 7 | Expression(expr body)
8 8
9 -- not really an actual node but useful in Jython's typesystem. 9 -- not really an actual node but useful in Jython's typesystem.
10 | Suite(stmt* body) 10 | Suite(stmt* body)
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 | UnaryOp(unaryop op, expr operand) 52 | UnaryOp(unaryop op, expr operand)
53 | Lambda(arguments args, expr body) 53 | Lambda(arguments args, expr body)
54 | IfExp(expr test, expr body, expr orelse) 54 | IfExp(expr test, expr body, expr orelse)
55 | Dict(expr* keys, expr* values) 55 | Dict(expr* keys, expr* values)
56 | Set(expr* elts) 56 | Set(expr* elts)
57 | ListComp(expr elt, comprehension* generators) 57 | ListComp(expr elt, comprehension* generators)
58 | SetComp(expr elt, comprehension* generators) 58 | SetComp(expr elt, comprehension* generators)
59 | DictComp(expr key, expr value, comprehension* generators) 59 | DictComp(expr key, expr value, comprehension* generators)
60 | GeneratorExp(expr elt, comprehension* generators) 60 | GeneratorExp(expr elt, comprehension* generators)
61 -- the grammar constrains where yield expressions can occur 61 -- the grammar constrains where yield expressions can occur
62 » | Yield(expr? value) 62 » | Yield(int is_from, expr? value)
63 -- need sequences for compare to distinguish between 63 -- need sequences for compare to distinguish between
64 -- x < 4 < 3 and (x < 4) < 3 64 -- x < 4 < 3 and (x < 4) < 3
65 | Compare(expr left, cmpop* ops, expr* comparators) 65 | Compare(expr left, cmpop* ops, expr* comparators)
66 | Call(expr func, expr* args, keyword* keywords, 66 | Call(expr func, expr* args, keyword* keywords,
67 expr? starargs, expr? kwargs) 67 expr? starargs, expr? kwargs)
68 | Num(object n) -- a number as a PyObject. 68 | Num(object n) -- a number as a PyObject.
69 | Str(string s) -- need to specify raw, unicode, etc? 69 | Str(string s) -- need to specify raw, unicode, etc?
70 | Bytes(bytes s) 70 | Bytes(bytes s)
71 | Ellipsis 71 | Ellipsis
72 -- other literals? bools? 72 -- other literals? bools?
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 110
111 -- keyword arguments supplied to call 111 -- keyword arguments supplied to call
112 keyword = (identifier arg, expr value) 112 keyword = (identifier arg, expr value)
113 113
114 -- import name with optional 'as' alias. 114 -- import name with optional 'as' alias.
115 alias = (identifier name, identifier? asname) 115 alias = (identifier name, identifier? asname)
116 116
117 withitem = (expr context_expr, expr? optional_vars) 117 withitem = (expr context_expr, expr? optional_vars)
118 } 118 }
119 119
OLDNEW
« Objects/exceptions.c ('K') | « Objects/genobject.c ('k') | Python/ast.c » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+