summaryrefslogtreecommitdiffstats
path: root/Parser
Commit message (Collapse)AuthorAgeFilesLines
* gh-131421: Fix ASDL kw_defaults being `expr*` instead of `expr?*` (GH-133773)Samuel2025-12-291-1/+1
| | | | Also fix docs ASDL highlighting.
* gh-122581: Use parser mutex in default build for subinterpreters (gh-142959)Sam Gross2025-12-201-10/+9
|
* gh-142724: fix error path in `_PyPegen_raise_tokenizer_init_error` (#142725)AZero132025-12-141-1/+1
|
* gh-142236: Improve error location for missing comma in string concatenations ↵Pablo Galindo Salgado2025-12-113-1/+31
| | | | (#142330)
* gh-130396: Remove _Py_ReachedRecursionLimitWithMargin() function (#141951)Victor Stinner2025-11-271-0/+1
| | | Move the private function to the internal C API (pycore_ceval.h).
* gh-135801: Add the module parameter to compile() etc (GH-139652)Serhiy Storchaka2025-11-137-7/+18
| | | | | | | Many functions related to compiling or parsing Python code, such as compile(), ast.parse(), symtable.symtable(), and importlib.abc.InspectLoader.source_to_code() now allow to pass the module name used when filtering syntax warnings.
* gh-140576: Fixed crash produced by lexer in case of dedented zero byte (#140583)Mikhail Efimov2025-10-291-0/+3
|
* gh-138944: Fix `SyntaxError` message for invalid syntax following valid ↵Brian Schubert2025-10-261-17/+36
| | | | import-as statement (#138945)
* gh-138857: Improve error message for `case` outside of `match` (#138858)sobolevn2025-10-241-0/+38
| | | | | | | * gh-138857: Improve error message for `case` outside of `match` --------- Co-authored-by: Bartosz Sławecki <bartosz@ilikepython.com>
* gh-140471: Fix buffer overflow in AST node initialization with malformed ↵Stan Ulbrych2025-10-231-2/+2
| | | | `_fields` (#140506)
* gh-140253: Improve the syntax error from an ill-positioned double-star ↵Bartosz Sławecki2025-10-221-506/+635
| | | | subpattern (#140254)
* gh-140149: Use PyBytesWriter in _build_concatenated_bytes() (#140150)Maurycy Pawłowski-Wieroński2025-10-161-6/+33
| | | | | | Use PyBytesWriter in action_helpers.c _build_concatenated_bytes(). 3x faster bytes concat in the parser. Co-authored-by: Victor Stinner <vstinner@python.org>
* gh-63161: Fix PEP 263 support (GH-139481)Serhiy Storchaka2025-10-106-33/+87
| | | | | | * Support non-UTF-8 shebang and comments if non-UTF-8 encoding is specified. * Detect decoding error in comments for UTF-8 encoding. * Include the decoding error position for default encoding in SyntaxError.
* gh-139516: Fix lambda colon start format spec in f-string in tokenizer (#139657)Tomasz Pytel2025-10-072-1/+3
|
* Remove unused prototype `_PyPegen_set_source_in_metadata` (#138810)Christoph Walcher2025-09-121-1/+0
| | | Remove unused prototype
* gh-138716: Fix `assert a := b` syntax error message (#138718)sobolevn2025-09-101-171/+245
|
* gh-136616: Improve `assert` syntax error messages (#136653)sobolevn2025-09-091-399/+513
|
* gh-137078: Fix keyword typo recognition when executed over files (#137079)Pablo Galindo Salgado2025-08-152-2/+5
|
* gh-137514: Add a free-threading wrapper for mutexes (GH-137515)Peter Bierma2025-08-071-16/+9
| | | Add `FT_MUTEX_LOCK`/`FT_MUTEX_UNLOCK`, which call `PyMutex_Lock` and `PyMutex_Unlock` on the free-threaded build, and no-op otherwise.
* gh-137314: Fix incorrect treatment of format specs in raw fstrings (#137328)Pablo Galindo Salgado2025-08-031-1/+9
|
* gh-132661: Disallow `Template`/`str` concatenation after PEP 750 spec update ↵Dave Peck2025-07-213-1169/+1349
| | | | | | | (#135996) Co-authored-by: sobolevn <mail@sobolevn.me> Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
* gh-135148: Correctly handle f/t strings with comments and debug expressions ↵Pablo Galindo Salgado2025-07-161-20/+68
| | | | (#135198)
* gh-135422: Fix regression in `SyntaxError` messages after #134036 (#135423)sobolevn2025-06-301-1865/+1860
|
* gh-129958: New syntax error in format spec applies to both f-strings and ↵Dylan2025-06-261-1/+2
| | | | | | | t-strings (#135570) Co-authored-by: Tomas R. <tomas.roun8@gmail.com> Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
* gh-135496: Fix f string exclamation mark error typo (#135495)GiGaGon2025-06-141-1/+1
|
* gh-130077: Properly match full soft keywords in the parser (#135317)Pablo Galindo Salgado2025-06-101-1/+2
|
* gh-133157: remove usage of `_Py_NO_SANITIZE_UNDEFINED` in `Parser/pegen.c` ↵Bénédikt Tran2025-06-103-94/+85
| | | | (#134048)
* gh-134036: Improve error messages for invalid `raise` statements (#134077)sobolevn2025-06-061-402/+499
|
* gh-135028: Increase parser MAXSTACK for nested parenthesis (#135031)Victor Stinner2025-06-031-1/+1
|
* gh-133968: Add PyUnicodeWriter_WriteASCII() function (#133973)Victor Stinner2025-05-291-3/+3
| | | | | | | | | | Replace most PyUnicodeWriter_WriteUTF8() calls with PyUnicodeWriter_WriteASCII(). Unrelated change to please the linter: remove an unused import in test_ctypes. Co-authored-by: Peter Bierma <zintensitydev@gmail.com> Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
* gh-133999: Fix `except` parsing regression in 3.14 (#134035)sobolevn2025-05-171-10/+22
|
* gh-133767: Fix use-after-free in the unicode-escape decoder with an error ↵Serhiy Storchaka2025-05-121-10/+16
| | | | | | | | | | | | | | handler (GH-129648) If the error handler is used, a new bytes object is created to set as the object attribute of UnicodeDecodeError, and that bytes object then replaces the original data. A pointer to the decoded data will became invalid after destroying that temporary bytes object. So we need other way to return the first invalid escape from _PyUnicode_DecodeUnicodeEscapeInternal(). _PyBytes_DecodeEscape() does not have such issue, because it does not use the error handlers registry, but it should be changed for compatibility with _PyUnicode_DecodeUnicodeEscapeInternal().
* gh-133783: Fix __replace__ on AST nodes for optional attributes (#133797)Jelle Zijlstra2025-05-101-0/+26
|
* gh-133379: Fix misuse of the term "arguments" in error messages (GH-133382)Stan Ulbrych2025-05-101-14/+14
| | | The right term is "parameters".
* gh-133516: Raise `ValueError` when constants `True`, `False` or `None` are ↵TERESH12025-05-071-0/+15
| | | | used as an identifier after NFKC normalization (#133523)
* gh-131421: Fix ASDL tests (#133408)Jelle Zijlstra2025-05-041-8/+12
| | | | PR #131419 broke this, but we failed to run tests on the PR due to a bug in our script.
* gh-131421: fix ASDL grammar for `Dict` to have an `expr?*` keys field (#131419)Samuel2025-05-042-28/+38
| | | | | | | | | | | | | 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>
* gh-133194: Fix regression with PEP 758 parsing on older `feature_version` ↵sobolevn2025-05-031-215/+304
| | | | | (#133289) gh-133192: Fix regression with PEP 758 parsing on older `feature_version`
* gh-133197: Improve error message for incompatible string / bytes prefixes ↵sobolevn2025-05-021-17/+56
| | | | (#133242)
* gh-123539: Improve SyntaxError msg for `import as` with not a name (#123629)sobolevn2025-05-021-725/+990
|
* gh-133196: Guard PEP 750 grammar with `CHECK_VERSION` (#133225)sobolevn2025-05-011-1/+1
|
* gh-133197: Improve error message for `ft""` and `bt""` cases (#133202)sobolevn2025-04-301-3/+17
|
* gh-133194: Add `CHECK_VERSION` to new PEP758 grammar (#133195)sobolevn2025-04-301-2/+2
|
* gh-132661: Implement PEP 750 (#132662)Lysandros Nikolaou2025-04-3013-1838/+3202
| | | | | | | | | | | | | 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>
* gh-129858: Special syntax error for `elif` block after `else` (#129902)Steele Farnsworth2025-04-251-75/+108
|
* gh-132449: Improve syntax error messages for keywords with typos (#132450)Pablo Galindo Salgado2025-04-224-435/+566
| | | | Signed-off-by: Pablo Galindo <pablogsal@gmail.com> Co-authored-by: Łukasz Langa <lukasz@langa.pl>
* gh-132769: Refactor possible read-out-of-bounds in `lexer.c` (#132770)sobolevn2025-04-211-1/+1
|
* gh-129958: Properly disallow newlines in format specs in single-quoted ↵Pablo Galindo Salgado2025-04-181-0/+8
| | | | f-strings (GH-130063)
* GH-131296: fix clang-cl warning on Windows in pegen.h (#131584)Chris Eibl2025-04-151-1/+1
|
* gh-131831: Implement PEP 758 – Allow except and except* expressions ↵Pablo Galindo Salgado2025-04-011-224/+323
| | | | without parentheses (#131833)