Mercurial > cpython-lru_cache-weakref
annotate Parser/Python.asdl @ 50076:c7abfab4dcdb 3.0
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
svn+ssh://svn.python.org/python/branches/py3k
........
r67525 | georg.brandl | 2008-12-04 19:18:16 +0100 (Thu, 04 Dec 2008) | 2 lines
#4527: fix "unicode or string".
........
r67526 | georg.brandl | 2008-12-04 19:19:41 +0100 (Thu, 04 Dec 2008) | 2 lines
#4526: fix typo.
........
r67527 | georg.brandl | 2008-12-04 19:21:46 +0100 (Thu, 04 Dec 2008) | 2 lines
#4521: fix getcwdu() vs getcwdb().
........
r67529 | georg.brandl | 2008-12-04 19:28:38 +0100 (Thu, 04 Dec 2008) | 2 lines
#4513: remove traces of zip() docstring from when it was izip().
........
r67548 | guido.van.rossum | 2008-12-05 06:49:12 +0100 (Fri, 05 Dec 2008) | 3 lines
Tweak verbiage and markup for relative/absolute import. Backport candidate.
(I guess *all* changes to this file should be backported to the 3.0 branch.)
........
r67549 | martin.v.loewis | 2008-12-05 08:20:46 +0100 (Fri, 05 Dec 2008) | 2 lines
Send mails to python-checkins now.
........
r67551 | georg.brandl | 2008-12-05 08:32:56 +0100 (Fri, 05 Dec 2008) | 2 lines
#4355: refer to urlencode in the correct module.
........
r67552 | georg.brandl | 2008-12-05 08:45:54 +0100 (Fri, 05 Dec 2008) | 2 lines
#4401: Re-add os.extsep.
........
r67555 | georg.brandl | 2008-12-05 08:57:51 +0100 (Fri, 05 Dec 2008) | 2 lines
#4427: fix arguments for "y" BuildValue type.
........
r67578 | georg.brandl | 2008-12-05 16:12:15 +0100 (Fri, 05 Dec 2008) | 2 lines
#4504, #4505: Update noddy examples in "Extending & Embedding".
........
r67586 | georg.brandl | 2008-12-05 16:55:41 +0100 (Fri, 05 Dec 2008) | 2 lines
Manually merged r67583: move __import__ doc to the bottom.
........
r67593 | georg.brandl | 2008-12-05 19:04:41 +0100 (Fri, 05 Dec 2008) | 2 lines
#4550: fix 2.x syntax in webservers howto.
........
r67594 | georg.brandl | 2008-12-05 19:06:58 +0100 (Fri, 05 Dec 2008) | 2 lines
#4549: Mention nonlocal statement in tutorial section about scoping.
........
r67596 | georg.brandl | 2008-12-05 19:31:51 +0100 (Fri, 05 Dec 2008) | 2 lines
Use :samp: role.
........
r67605 | georg.brandl | 2008-12-06 09:12:11 +0100 (Sat, 06 Dec 2008) | 2 lines
#4557: remove 'c' typecode from array docs and add a note in whatsnew.
........
r67606 | georg.brandl | 2008-12-06 09:14:46 +0100 (Sat, 06 Dec 2008) | 2 lines
cmp() is not really gone.
........
r67609 | georg.brandl | 2008-12-06 15:28:56 +0100 (Sat, 06 Dec 2008) | 2 lines
#4562: fix zip() examples.
........
r67612 | skip.montanaro | 2008-12-06 18:25:02 +0100 (Sat, 06 Dec 2008) | 2 lines
issue 4483 - _dbm build failures on systems with gdbm_compat lib.
........
r67616 | benjamin.peterson | 2008-12-06 19:32:13 +0100 (Sat, 06 Dec 2008) | 1 line
there are only four asdl builtin types in py3k
........
r67617 | benjamin.peterson | 2008-12-06 19:33:20 +0100 (Sat, 06 Dec 2008) | 1 line
update version number
........
r67632 | georg.brandl | 2008-12-07 15:09:20 +0100 (Sun, 07 Dec 2008) | 2 lines
#4576: fix ob_type access.
........
r67635 | benjamin.peterson | 2008-12-07 15:58:03 +0100 (Sun, 07 Dec 2008) | 1 line
document how to deal with binary standard streams
........
r67638 | benjamin.peterson | 2008-12-07 16:07:02 +0100 (Sun, 07 Dec 2008) | 1 line
remove extraneous 'text'
........
| author | Georg Brandl <georg@python.org> |
|---|---|
| date | Sun, 07 Dec 2008 15:52:13 +0000 |
| parents | 81ee270a6eb5 |
| 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 |
