summaryrefslogtreecommitdiffstats
path: root/Include/asdl.h
Commit message (Collapse)AuthorAgeFilesLines
* bpo-41746: Add type information to asdl_seq objects (GH-22223)Pablo Galindo2020-09-161-8/+63
| | | | | | | | | | | | | * Add new capability to the PEG parser to type variable assignments. For instance: ``` | a[asdl_stmt_seq*]=';'.small_stmt+ [';'] NEWLINE { a } ``` * Add new sequence types from the asdl definition (automatically generated) * Make `asdl_seq` type a generic aliasing pointer type. * Create a new `asdl_generic_seq` for the generic case using `void*`. * The old `asdl_seq_GET`/`ast_seq_SET` macros now are typed. * New `asdl_seq_GET_UNTYPED`/`ast_seq_SET_UNTYPED` macros for dealing with generic sequences. * Changes all possible `asdl_seq` types to use specific versions everywhere.
* bpo-40528: Improve and clear several aspects of the ASDL definition code for ↵Batuhan Taskaya2020-05-061-2/+0
| | | | the AST (GH-19952)
* bpo-21120: Exclude Python-ast.h, ast.h and asdl.h from the limited API (#14634)Zackery Spytz2019-09-121-0/+2
| | | | The PyArena type is not part of the limited API, so these headers shouldn't be part of it either.
* bpo-18407: ast.c uses Py_ssize_t for asdl_seq_LEN() iterator (GH-10655)Victor Stinner2018-11-221-1/+1
| | | | | | | When iterating using asdl_seq_LEN(), use 'Py_ssize_t' type instead of 'int' for the iterator variable, to avoid downcast on 64-bit platforms. _Py_asdl_int_seq_new() now also ensures that the index is greater than or equal to 0.
* Add ast.ConstantVictor Stinner2016-01-251-0/+1
| | | | | | | | | | | | | | | | | | | | | Issue #26146: Add a new kind of AST node: ast.Constant. It can be used by external AST optimizers, but the compiler does not emit directly such node. An optimizer can replace the following AST nodes with ast.Constant: * ast.NameConstant: None, False, True * ast.Num: int, float, complex * ast.Str: str * ast.Bytes: bytes * ast.Tuple if items are constants too: tuple * frozenset Update code to accept ast.Constant instead of ast.Num and/or ast.Str: * compiler * docstrings * ast.literal_eval() * Tools/parser/unparse.py
* Fix compiler warning on Windows 64-bit: asdl_seq_SET() stores the index ↵Victor Stinner2013-11-151-4/+6
| | | | | | parameter into a Py_ssize_t, instead of an int
* Issue #4555: All exported C symbols are now prefixed with either "Py" or "_Py".Antoine Pitrou2013-10-121-2/+2
| | | | ("make smelly" now clean)
* create NameConstant AST class for None, True, and False literals (closes #16619)Benjamin Peterson2012-12-061-0/+1
|
* Widen ASDL sequences to Py_ssize_t lengths to better match PEP 353.Martin v. Löwis2012-05-151-4/+4
|
* add a asdl bytes type, so Bytes.s be properly typecheckedBenjamin Peterson2011-08-091-0/+1
|
* Whoops, fix build breakage. There were still a few uses of the bool type.Neal Norwitz2007-02-261-4/+0
| | | | Remove the last few uses of bool/true/false.
* Merge p3yk branch with the trunk up to revision 45595. This breaks a fairThomas Wouters2006-04-211-0/+8
| | | | | | | | | | | | | | | | | | | | number of tests, all because of the codecs/_multibytecodecs issue described here (it's not a Py3K issue, just something Py3K discovers): http://mail.python.org/pipermail/python-dev/2006-April/064051.html Hye-Shik Chang promised to look for a fix, so no need to fix it here. The tests that are expected to break are: test_codecencodings_cn test_codecencodings_hk test_codecencodings_jp test_codecencodings_kr test_codecencodings_tw test_codecs test_multibytecodec This merge fixes an actual test failure (test_weakref) in this branch, though, so I believe merging is the right thing to do anyway.
* Remove asdl_seq_APPEND() and simplify asdl seq implementation.Jeremy Hylton2006-02-281-12/+2
| | | | Clarify intended use of set_context() and check errors at all call sites.
* Merge from ast-arena. This reduces the code in Python/ast.c by ~300 lines,Neal Norwitz2005-12-171-1/+1
| | | | simplifies a lot of error handling code, and fixes many memory leaks.
* Whoops, checkin consistent versions of *all* files to stop pollutingNeal Norwitz2005-11-131-7/+0
| | | | a bunch of names
* Merge ast-branch to headJeremy Hylton2005-10-201-0/+54
This change implements a new bytecode compiler, based on a transformation of the parse tree to an abstract syntax defined in Parser/Python.asdl. The compiler implementation is not complete, but it is in stable enough shape to run the entire test suite excepting two disabled tests.