| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
(GH-27432)
|
| |
|
|
|
| |
Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
These functions were undocumented and excluded from the limited C
API.
Most names defined by these header files were not prefixed by "Py"
and so could create names conflicts. For example, Python-ast.h
defined a "Yield" macro which was conflict with the "Yield" name used
by the Windows <winbase.h> header.
Use the Python ast module instead.
* Move Include/asdl.h to Include/internal/pycore_asdl.h.
* Move Include/Python-ast.h to Include/internal/pycore_ast.h.
* Remove ast.h header file.
* pycore_symtable.h no longer includes Python-ast.h.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Remove the PyAST_Validate() function. It is no longer possible to
build a AST object (mod_ty type) with the public C API. The function
was already excluded from the limited C API (PEP 384).
Rename PyAST_Validate() function to _PyAST_Validate(), move it to the
internal C API, and don't export it anymore (replace PyAPI_FUNC with
extern).
The function was added in bpo-12575 by
the commit 832bfe2ebd5ecfa92031cd40c8b41835ba90487f.
|
|
|
|
|
| |
Co-authored-by: Guido van Rossum <guido@python.org>
Co-authored-by: Talin <viridia@gmail.com>
Co-authored-by: Pablo Galindo <pablogsal@gmail.com>
|
|
|
|
|
|
|
|
| |
- Use the proper asdl sequence when creating empty arguments
- Remove reduntant casts (thanks to new typed asdl_sequences)
- Remove MarshalPrototypeVisitor and some utilities from asdl generator
- Fix the header of `Python/ast.c` (kept from pgen times)
Automerge-Triggered-By: @pablogsal
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
| |
Remove some remaining files and Makefile targets for the old parser
|
|
|
| |
This commit removes the old parser, the deprecated parser module, the old parser compatibility flags and environment variables and all associated support code and documentation.
|
| |
|
|
|
|
| |
Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
Co-authored-by: Pablo Galindo <pablogsal@gmail.com>
|
|
|
| |
Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
|
|
|
|
| |
data. (GH-19345)
|
|
|
|
| |
(GH-19348)
|
| |
|
| |
|
| |
|
|
|
|
|
| |
(GH-19055)
Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
* Remove the slice type.
* Make Slice a kind of the expr type instead of the slice type.
* Replace ExtSlice(slices) with Tuple(slices, Load()).
* Replace Index(value) with a value itself.
All non-terminal nodes in AST for expressions are now of the expr type.
|
|
|
|
|
|
|
|
| |
The AST "Suite" node is no longer used and it can be removed from the ASDL definition and related structures (compiler, visitors, ...).
Co-Authored-By: Victor Stinner <vstinner@python.org>
Co-authored-by: Brett Cannon <54418+brettcannon@users.noreply.github.com>
Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
The fix changes copy_location() to require an extra node from which to extract the end location, and fixing all 5 call sites.
https://bugs.python.org/issue39235
|
| |
|
|
|
|
| |
Co-Authored-By: Pablo Galindo <Pablogsal@gmail.com>
|
|
|
| |
Automerge-Triggered-By: @gvanrossum
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
if_stmt (GH-17582)
When parsing an "elif" node, lineno and col_offset of the node now point to the "elif" keyword and not to its condition, making it consistent with the "if" node.
https://bugs.python.org/issue39031
Automerge-Triggered-By: @pablogsal
|
|
|
|
| |
decorators. (GH-16861)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
All call sites pass NULL for `recode_encoding`, so this path is
completely untested. That's been true since before Python 3.0.
It adds significant complexity to this logic, so it's best to
take it out.
All call sites now have a literal NULL, and that's been true since
commit 768921cf3 eliminated a conditional (`foo ? bar : NULL`) at
the call site in Python/ast.c where we're parsing a bytes literal.
But even before then, that condition `foo` had been a constant
since unadorned string literals started meaning Unicode, in commit
572dbf8f1 aka v3.0a1~1035 .
The `unicode` parameter is already unused, so mark it as unused too.
The code that acted on it was also taken out before Python 3.0, in
commit 8d30cc014 aka v3.0a1~1031 .
The function (PyBytes_DecodeEscape) is exposed in the API, but it's
never been documented.
|
|
|
|
|
|
|
|
|
|
|
| |
Interned string needs to be decref'd
https://bugs.python.org/issue38138
Automerge-Triggered-By: @matrixise
|
|
|
|
|
|
|
|
|
|
| |
Removes statics for better subinterpreter support and moves to _PyType_Name
https://bugs.python.org/issue38113
Automerge-Triggered-By: @tiran
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
DeprecationWarning will continue to be emitted for invalid escape
sequences in string and bytes literals just as it did in 3.7.
SyntaxWarning may be emitted in the future. But per mailing list
discussion, we don't yet know when because we haven't settled on how to
do so in a non-disruptive manner.
(Applies 4c5b6bac2408f879231c7cd38d67657dd4804e7c to the master branch).
(This is https://github.com/python/cpython/pull/15142 for master/3.9)
https://bugs.python.org/issue32912
Automerge-Triggered-By: @gpshead
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Fix typos in comments, docs and test names
* Update test_pyparse.py
account for change in string length
* Apply suggestion: splitable -> splittable
Co-Authored-By: Terry Jan Reedy <tjreedy@udel.edu>
* Apply suggestion: splitable -> splittable
Co-Authored-By: Terry Jan Reedy <tjreedy@udel.edu>
* Apply suggestion: Dealloccte -> Deallocate
Co-Authored-By: Terry Jan Reedy <tjreedy@udel.edu>
* Update posixmodule checksum.
* Reverse idlelib changes.
|
|
|
|
|
| |
ast.parameters nodes (GH-14778)
https://bugs.python.org/issue37593
|
|
|
|
|
| |
Nested BinOp instances (e.g. a+b+c) had a wrong col_offset for the
second BinOp (e.g. 2 instead of 0 in the example). Fix it by using the
correct st node to copy the line and col_offset from in ast.c.
|
|
|
| |
default case ought to handle the "unexpected".
|
|
|
|
|
| |
Add a new _PyCompilerFlags_INIT macro to initialize PyCompilerFlags
variables, rather than initializing cf_flags and cf_feature_version
explicitly in each variable.
|
|
|
|
| |
(GH-13760)
|
|
|
|
| |
defaults (GH-13697)
|
|
|
|
| |
* Clean up some comments, fix potential memory leaks, clarify literal and expr_text.
|
|
|
|
|
| |
I'm confident that this fixes the reported crash. flags=NULL is treated as using the latest minor version.
https://bugs.python.org/issue37072
|
|
|
|
|
| |
instead (GH-13597)
When using the "=" debug functionality of f-strings, use another Constant node (or a merged constant node) instead of adding expr_text to the FormattedValue node.
|
|
|
|
|
| |
GH-13238 made extra text after a # type: ignore accepted by the parser.
This finishes the job and actually plumbs the extra text through the
parser and makes it available in the AST.
|