Mercurial > cpython-lru_cache-weakref
annotate Parser/Python.asdl @ 66978:aed2bbafa550 3.1
Blocked revisions 87324 via svnmerge
........
r87324 | r.david.murray | 2010-12-16 14:08:51 -0500 (Thu, 16 Dec 2010) | 9 lines
#10719: restore messages generated on invalid compileall args
Before the introduction of filename arguments to compileall it gave semi useful
messages about not being able to 'list' names that weren't valid directories.
This fix restores that behavior. In addition to the test for this case, the
patch also adds a test for the default behavior of compileall when no arguments
are provided, and fixes a bug in one of the previously added tests.
........
| author | R. David Murray <rdmurray@bitdance.com> |
|---|---|
| date | Thu, 16 Dec 2010 19:10:16 +0000 |
| parents | c7abfab4dcdb |
| children | 0704f15b4682 |
| rev | line source |
|---|---|
|
50076
c7abfab4dcdb
Merged revisions 67525-67527,67529,67548-67549,67551-67552,67555,67578,67586,67593-67594,67596,67605-67606,67609,67612,67616-67617,67632,67635,67638 via svnmerge from
Georg Brandl <georg@python.org>
parents:
46231
diff
changeset
|
1 -- ASDL's four builtin types are identifier, int, string, object |
| 35742 | 2 |
|
36703
9f3e58dbea63
Add support for version field on Modules
Martin v. Löwis <martin@v.loewis.de>
parents:
36695
diff
changeset
|
3 module Python version "$Revision$" |
| 35742 | 4 { |
| 5 mod = Module(stmt* body) | |
| 6 | Interactive(stmt* body) | |
| 7 | Expression(expr body) | |
| 8 | |
| 9 -- not really an actual node but useful in Jython's typesystem. | |
| 10 | Suite(stmt* body) | |
| 11 | |
| 12 stmt = FunctionDef(identifier name, arguments args, | |
|
41824
24b60622b944
Merged revisions 55407-55513 via svnmerge from
Guido van Rossum <guido@python.org>
parents:
41717
diff
changeset
|
13 stmt* body, expr* decorator_list, expr? returns) |
|
41226
19f7ff443718
Implement PEP 3115 -- new metaclass syntax and semantics.
Guido van Rossum <guido@python.org>
parents:
40965
diff
changeset
|
14 | ClassDef(identifier name, |
|
19f7ff443718
Implement PEP 3115 -- new metaclass syntax and semantics.
Guido van Rossum <guido@python.org>
parents:
40965
diff
changeset
|
15 expr* bases, |
|
19f7ff443718
Implement PEP 3115 -- new metaclass syntax and semantics.
Guido van Rossum <guido@python.org>
parents:
40965
diff
changeset
|
16 keyword* keywords, |
|
19f7ff443718
Implement PEP 3115 -- new metaclass syntax and semantics.
Guido van Rossum <guido@python.org>
parents:
40965
diff
changeset
|
17 expr? starargs, |
|
19f7ff443718
Implement PEP 3115 -- new metaclass syntax and semantics.
Guido van Rossum <guido@python.org>
parents:
40965
diff
changeset
|
18 expr? kwargs, |
|
41824
24b60622b944
Merged revisions 55407-55513 via svnmerge from
Guido van Rossum <guido@python.org>
parents:
41717
diff
changeset
|
19 stmt* body, |
|
24b60622b944
Merged revisions 55407-55513 via svnmerge from
Guido van Rossum <guido@python.org>
parents:
41717
diff
changeset
|
20 expr *decorator_list) |
| 35742 | 21 | Return(expr? value) |
| 22 | |
| 23 | Delete(expr* targets) | |
| 24 | Assign(expr* targets, expr value) | |
| 25 | AugAssign(expr target, operator op, expr value) | |
| 26 | |
| 27 -- use 'orelse' because else is a keyword in target languages | |
| 28 | For(expr target, expr iter, stmt* body, stmt* orelse) | |
| 29 | While(expr test, stmt* body, stmt* orelse) | |
| 30 | If(expr test, stmt* body, stmt* orelse) | |
|
36695
b6d2f6fd3e11
PEP 343 -- the with-statement.
Guido van Rossum <guido@python.org>
parents:
36666
diff
changeset
|
31 | With(expr context_expr, expr? optional_vars, stmt* body) |
| 35742 | 32 |
|
43102
981ecc526703
Issue #1066: implement PEP 3109, 2/3 of PEP 3134.
Collin Winter <collinw@gmail.com>
parents:
42193
diff
changeset
|
33 | Raise(expr? exc, expr? cause) |
| 35742 | 34 | TryExcept(stmt* body, excepthandler* handlers, stmt* orelse) |
| 35 | TryFinally(stmt* body, stmt* finalbody) | |
| 36 | Assert(expr test, expr? msg) | |
| 37 | |
| 38 | Import(alias* names) | |
|
36712
5c36c222e7ca
SF patch #1438387, PEP 328: relative and absolute imports.
Thomas Wouters <thomas@python.org>
parents:
36703
diff
changeset
|
39 | ImportFrom(identifier module, alias* names, int? level) |
| 35742 | 40 |
| 41 | Global(identifier* names) | |
|
40965
30e5cb3a55ac
Provisional implementation of PEP 3104.
Jeremy Hylton <jeremy@alum.mit.edu>
parents:
40940
diff
changeset
|
42 | Nonlocal(identifier* names) |
| 35742 | 43 | Expr(expr value) |
| 44 | Pass | Break | Continue | |
| 45 | |
| 46 -- XXX Jython will be different | |
|
36786
57322cb2ca11
Patch #1440601: Add col_offset attribute to AST nodes.
Martin v. Löwis <martin@v.loewis.de>
parents:
36712
diff
changeset
|
47 -- col_offset is the byte offset in the utf8 string the parser uses |
|
57322cb2ca11
Patch #1440601: Add col_offset attribute to AST nodes.
Martin v. Löwis <martin@v.loewis.de>
parents:
36712
diff
changeset
|
48 attributes (int lineno, int col_offset) |
| 35742 | 49 |
| 50 -- BoolOp() can use left & right? | |
| 51 expr = BoolOp(boolop op, expr* values) | |
| 52 | BinOp(expr left, operator op, expr right) | |
| 53 | UnaryOp(unaryop op, expr operand) | |
| 54 | Lambda(arguments args, expr body) | |
|
36666
6165927431d6
PEP 308 implementation, including minor refdocs and some testcases. It
Thomas Wouters <thomas@python.org>
parents:
36418
diff
changeset
|
55 | IfExp(expr test, expr body, expr orelse) |
| 35742 | 56 | Dict(expr* keys, expr* values) |
|
39693
d0b83c4630c0
SF patch 1547796 by Georg Brandl -- set literals.
Guido van Rossum <guido@python.org>
parents:
39678
diff
changeset
|
57 | Set(expr* elts) |
| 35742 | 58 | ListComp(expr elt, comprehension* generators) |
|
42193
090588a17490
Merged revisions 56154-56264 via svnmerge from
Guido van Rossum <guido@python.org>
parents:
41824
diff
changeset
|
59 | SetComp(expr elt, comprehension* generators) |
|
090588a17490
Merged revisions 56154-56264 via svnmerge from
Guido van Rossum <guido@python.org>
parents:
41824
diff
changeset
|
60 | DictComp(expr key, expr value, comprehension* generators) |
| 35742 | 61 | GeneratorExp(expr elt, comprehension* generators) |
|
36418
a625e8876407
Improved handling of syntax errors.
Jeremy Hylton <jeremy@alum.mit.edu>
parents:
35871
diff
changeset
|
62 -- the grammar constrains where yield expressions can occur |
| 35742 | 63 | Yield(expr? value) |
| 64 -- need sequences for compare to distinguish between | |
| 65 -- x < 4 < 3 and (x < 4) < 3 | |
| 66 | Compare(expr left, cmpop* ops, expr* comparators) | |
| 67 | Call(expr func, expr* args, keyword* keywords, | |
| 68 expr? starargs, expr? kwargs) | |
| 69 | Num(object n) -- a number as a PyObject. | |
| 70 | Str(string s) -- need to specify raw, unicode, etc? | |
| 40894 | 71 | Bytes(string s) |
|
39783
7a0ad110e91e
Patch #1550786: ellipsis literal.
Georg Brandl <georg@python.org>
parents:
39782
diff
changeset
|
72 | Ellipsis |
| 35742 | 73 -- other literals? bools? |
| 74 | |
| 75 -- the following expression can appear in assignment context | |
| 76 | Attribute(expr value, identifier attr, expr_context ctx) | |
| 77 | Subscript(expr value, slice slice, expr_context ctx) | |
|
41699
e16c8e5c5ca4
Merged revisions 55225-55227,55229-55269 via svnmerge from
Guido van Rossum <guido@python.org>
parents:
41464
diff
changeset
|
78 | Starred(expr value, expr_context ctx) |
| 35742 | 79 | Name(identifier id, expr_context ctx) |
| 80 | List(expr* elts, expr_context ctx) | |
|
40893
32c4897b5d46
Merged revisions 53623-53858 via svnmerge from
Thomas Wouters <thomas@python.org>
parents:
40788
diff
changeset
|
81 | Tuple(expr* elts, expr_context ctx) |
| 35742 | 82 |
|
36786
57322cb2ca11
Patch #1440601: Add col_offset attribute to AST nodes.
Martin v. Löwis <martin@v.loewis.de>
parents:
36712
diff
changeset
|
83 -- col_offset is the byte offset in the utf8 string the parser uses |
|
57322cb2ca11
Patch #1440601: Add col_offset attribute to AST nodes.
Martin v. Löwis <martin@v.loewis.de>
parents:
36712
diff
changeset
|
84 attributes (int lineno, int col_offset) |
| 35742 | 85 |
| 86 expr_context = Load | Store | Del | AugLoad | AugStore | Param | |
| 87 | |
|
39783
7a0ad110e91e
Patch #1550786: ellipsis literal.
Georg Brandl <georg@python.org>
parents:
39782
diff
changeset
|
88 slice = Slice(expr? lower, expr? upper, expr? step) |
| 35742 | 89 | ExtSlice(slice* dims) |
| 90 | Index(expr value) | |
| 91 | |
| 92 boolop = And | Or | |
| 93 | |
| 94 operator = Add | Sub | Mult | Div | Mod | Pow | LShift | |
| 95 | RShift | BitOr | BitXor | BitAnd | FloorDiv | |
| 96 | |
| 97 unaryop = Invert | Not | UAdd | USub | |
| 98 | |
| 99 cmpop = Eq | NotEq | Lt | LtE | Gt | GtE | Is | IsNot | In | NotIn | |
| 100 | |
| 101 comprehension = (expr target, expr iter, expr* ifs) | |
| 102 | |
| 103 -- not sure what to call the first argument for raise and except | |
|
46231
81ee270a6eb5
Merged revisions 62047 via svnmerge from
Neal Norwitz <nnorwitz@gmail.com>
parents:
43102
diff
changeset
|
104 excepthandler = ExceptHandler(expr? type, identifier? name, stmt* body) |
|
81ee270a6eb5
Merged revisions 62047 via svnmerge from
Neal Norwitz <nnorwitz@gmail.com>
parents:
43102
diff
changeset
|
105 attributes (int lineno, int col_offset) |
| 35742 | 106 |
|
40529
54cd47788811
PEP 3107 - Function Annotations thanks to Tony Lownds
Neal Norwitz <nnorwitz@gmail.com>
parents:
40215
diff
changeset
|
107 arguments = (arg* args, identifier? vararg, expr? varargannotation, |
|
54cd47788811
PEP 3107 - Function Annotations thanks to Tony Lownds
Neal Norwitz <nnorwitz@gmail.com>
parents:
40215
diff
changeset
|
108 arg* kwonlyargs, identifier? kwarg, |
|
54cd47788811
PEP 3107 - Function Annotations thanks to Tony Lownds
Neal Norwitz <nnorwitz@gmail.com>
parents:
40215
diff
changeset
|
109 expr? kwargannotation, expr* defaults, |
|
54cd47788811
PEP 3107 - Function Annotations thanks to Tony Lownds
Neal Norwitz <nnorwitz@gmail.com>
parents:
40215
diff
changeset
|
110 expr* kw_defaults) |
|
41717
9ad84070b22d
Merged revisions 55328-55341 via svnmerge from
Guido van Rossum <guido@python.org>
parents:
41699
diff
changeset
|
111 arg = (identifier arg, expr? annotation) |
| 35742 | 112 |
| 113 -- keyword arguments supplied to call | |
| 114 keyword = (identifier arg, expr value) | |
| 115 | |
| 116 -- import name with optional 'as' alias. | |
| 117 alias = (identifier name, identifier? asname) | |
| 118 } | |
|
40895
bd1419e94773
Touch file to regenerate Python-ast.[ch]
Thomas Wouters <thomas@python.org>
parents:
40894
diff
changeset
|
119 |
