| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
| |
PR #131419 broke this, but we failed to run tests on the PR due to a bug
in our script.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
In the `ast` documentation for Python:
* https://docs.python.org/3/library/ast.html#ast.Dict
it is made clear that:
> When doing dictionary unpacking using dictionary literals the expression to be expanded goes in the values list, with a `None` at the corresponding position in `keys`.
Hence, `keys` is really a `expr?*` and *not* a `expr*`.
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
|
| |
|
|
|
| |
(#133289)
gh-133192: Fix regression with PEP 758 parsing on older `feature_version`
|
| |
|
|
| |
(#133242)
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Wingy <git@wingysam.xyz>
Co-authored-by: Koudai Aono <koxudaxi@gmail.com>
Co-authored-by: Dave Peck <davepeck@gmail.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Co-authored-by: Paul Everitt <pauleveritt@me.com>
Co-authored-by: sobolevn <mail@sobolevn.me>
|
| | |
|
| |
|
|
| |
Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
|
| | |
|
| |
|
|
| |
f-strings (GH-130063)
|
| | |
|
| |
|
|
| |
without parentheses (#131833)
|
| |
|
|
| |
For example, expression_rule() return type is 'expr_ty', whereas
_PyPegen_lookahead() uses 'void*'.
|
| |
|
|
| |
NULL value (#131764)
|
| |
|
| |
Remove also now unused includes in C files.
|
| |
|
|
| |
PyMutex type is now part of <Python.h>, it's no longer needed to
include <pycore_lock.h> to get it.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
* Remove includes from pycore_pystate.h:
* pycore_runtime_structs.h
* pycore_runtime.h
* pycore_tstate.h
* pycore_interp.h
* Reorganize internal headers. Move _gc_thread_state from
pycore_interp_structs.h to pycore_tstate.h.
* Add 3 new header files to PCbuild/pythoncore.vcxproj.
|
| |
|
|
| |
Adds new pycore_stats.h header file to help break dependencies involving the pycore_code.h header.
|
| | |
|
| |
|
|
|
| |
* Moves most structs in pycore_ header files into pycore_structs.h and pycore_runtime_structs.h
* Removes many cross-header dependencies
|
| | |
|
| |
|
|
|
| |
Move some `#include <stdbool.h>` after `#include "Python.h"` when `pyconfig.h` is not
included first and when we are in a platform-agnostic context. This is to avoid having
features defined by `stdbool.h` before those decided by `Python.h`.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
| |
* Implement C recursion protection with limit pointers for Linux, MacOS and Windows
* Remove calls to PyOS_CheckStack
* Add stack protection to parser
* Make tests more robust to low stacks
* Improve error messages for stack overflow
|
| |
|
|
|
|
|
|
|
| |
counters. (GH-130007)" for now (GH130413)
Revert "GH-91079: Implement C stack limits using addresses, not counters. (GH-130007)" for now
Unfortunatlely, the change broke some buildbots.
This reverts commit 2498c22fa0a2b560491bc503fa676585c1a603d0.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
* Implement C recursion protection with limit pointers
* Remove calls to PyOS_CheckStack
* Add stack protection to parser
* Make tests more robust to low stacks
* Improve error messages for stack overflow
|
| |
|
|
|
| |
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
(#116049)
|
| |
|
|
|
|
|
|
|
|
|
| |
Add PyImport_ImportModuleAttr() and
PyImport_ImportModuleAttrString() functions.
* Add unit tests.
* Replace _PyImport_GetModuleAttr()
with PyImport_ImportModuleAttr().
* Replace _PyImport_GetModuleAttrString()
with PyImport_ImportModuleAttrString().
* Remove "pycore_import.h" includes, no longer needed.
|
| |
|
|
|
|
| |
Replace the private _PyUnicodeWriter API with the public
PyUnicodeWriter API.
Use PyUnicodeWriter_WriteRepr() in ast_repr_list().
|
| |
|
| |
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
|
| |
|
|
| |
contains `!` (#129159)
|
| | |
|
| | |
|
| |
|
| |
check return value of `_Py_asdl_expr_seq_new`
|
| |
|
|
| |
Previously, if the `ast.AST._fields` attribute was deleted, attempts to create a new `as`t node would crash due to the assumption that `_fields` always had a non-NULL value. Now it has been fixed by adding an extra check to ensure that `_fields` does not have a NULL value (this can happen when you manually remove `_fields` attribute).
|
| |
|
|
| |
Replace the private _PyUnicodeWriter API with the public
PyUnicodeWriter API in _PyPegen_concatenate_strings().
|
| |
|
|
|
| |
When formatting the AST as a string, infinite values are replaced by
1e309, which evaluates to infinity. The initialization of this string
replacement was not thread-safe in the free threading build.
|
| |
|
|
|
| |
Replace PyUnicode_New(0, 0), PyUnicode_FromString("")
and PyUnicode_FromStringAndSize("", 0)
with Py_GetConstant(Py_CONSTANT_EMPTY_STR).
|
| |
|
|
| |
Replace PyBytes_FromString("") and PyBytes_FromStringAndSize("", 0)
with Py_GetConstant(Py_CONSTANT_EMPTY_BYTES).
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Cache in C PEG-generator reworked:
we save artificial rules in cache by Node string representation as a key instead of Node object itself.
As a result total count of artificial rules in parsers.c is lowered from 283 to 170.
More natural number ordering is used for the names of artificial rules.
Auxiliary method CCallMakerVisitor._generate_artificial_rule_call is added.
Its purpose is abstracting work with artificial rules cache.
Explicit using of "is_repeat1" kwarg is added to visit_Repeat0 and visit_Repeat1 methods.
Its slightly improve code readabitily.
|