summaryrefslogtreecommitdiffstats
path: root/Parser
Commit message (Collapse)AuthorAgeFilesLines
* gh-109120: Fix syntax error in handlinh of incorrect star expressions (#117444)Grigoriev Semyon2024-04-021-1230/+1417
|
* gh-117266: Fix crashes on user-created AST subclasses (GH-117276)Jelle Zijlstra2024-03-281-2/+13
| | | Fix crashes on user-created AST subclasses
* bpo-24612: Improve syntax error for 'not' after an operator (GH-28170)Pablo Galindo Salgado2024-03-261-594/+970
| | | Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
* gh-116437: Use new C API PyDict_Pop() to simplify the code (GH-116438)Serhiy Storchaka2024-03-071-9/+9
|
* gh-105858: Improve AST node constructors (#105880)Jelle Zijlstra2024-02-281-7/+231
| | | | | | | | | | | | | | | | | Demonstration: >>> ast.FunctionDef.__annotations__ {'name': <class 'str'>, 'args': <class 'ast.arguments'>, 'body': list[ast.stmt], 'decorator_list': list[ast.expr], 'returns': ast.expr | None, 'type_comment': str | None, 'type_params': list[ast.type_param]} >>> ast.FunctionDef() <stdin>:1: DeprecationWarning: FunctionDef.__init__ missing 1 required positional argument: 'name'. This will become an error in Python 3.15. <stdin>:1: DeprecationWarning: FunctionDef.__init__ missing 1 required positional argument: 'args'. This will become an error in Python 3.15. <ast.FunctionDef object at 0x101959460> >>> node = ast.FunctionDef(name="foo", args=ast.arguments()) >>> node.decorator_list [] >>> ast.FunctionDef(whatever="you want", name="x", args=ast.arguments()) <stdin>:1: DeprecationWarning: FunctionDef.__init__ got an unexpected keyword argument 'whatever'. Support for arbitrary keyword arguments is deprecated and will be removed in Python 3.15. <ast.FunctionDef object at 0x1019581f0>
* gh-115823: Calculate correctly error locations when dealing with implicit ↵Pablo Galindo Salgado2024-02-261-11/+9
| | | | encodings (#115824)
* gh-115881: Ensure `ast.parse()` parses conditional context managers even ↵Alex Waygood2024-02-261-1/+1
| | | | with low `feature_version` passed (#115920)
* gh-113744: Add a new IncompleteInputError exception to improve incomplete ↵Pablo Galindo Salgado2024-01-301-1/+1
| | | | | input detection in the codeop module (#113745) Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
* gh-114569: Use PyMem_* APIs for most non-PyObject uses (#114574)Erlend E. Aasland2024-01-261-2/+2
| | | Fix usage in Modules, Objects, and Parser subdirectories.
* GH-113655: Lower the C recursion limit on various platforms (GH-113944)Mark Shannon2024-01-161-3/+2
|
* gh-111488: Changed error message in case of no 'in' keyword after 'for' in ↵Grigoriev Semyon2024-01-061-1592/+1785
| | | | cmp (#113656)
* gh-113703: Correctly identify incomplete f-strings in the codeop module ↵Pablo Galindo Salgado2024-01-051-2/+6
| | | | (#113709)
* gh-113602: Bail out when the parser tries to override existing errors (#113607)Pablo Galindo Salgado2024-01-021-0/+4
| | | Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
* gh-106905: Use separate structs to track recursion depth in each ↵Yilei Yang2023-12-251-25/+28
| | | | | | PyAST_mod2obj call. (GH-113035) Co-authored-by: Gregory P. Smith [Google LLC] <greg@krypto.org>
* gh-112943: Correctly compute end offsets for multiline tokens in the ↵Pablo Galindo Salgado2023-12-112-5/+12
| | | | tokenize module (#112949)
* Fix typos in variable names, function names, and comments (GH-101868)Yang Hau2023-12-011-1/+1
|
* gh-112387: Fix error positions for decoded strings with backwards tokenize ↵Pablo Galindo Salgado2023-11-271-0/+4
| | | | | errors (#112409) Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
* gh-112388: Fix an error that was causing the parser to try to overwrite ↵Pablo Galindo Salgado2023-11-271-0/+4
| | | | | tokenizer errors (#112410) Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
* gh-112243: Don't include comments in f-string debug expressions (#112284)Pablo Galindo Salgado2023-11-201-6/+49
|
* bpo-45759: Better error messages for non-matching 'elif'/'else' statements ↵Crowthebird2023-11-201-435/+533
| | | | (#29513)
* GH-111807: Lower the parser stack depth under WASI debug builds (#112225)Brett Cannon2023-11-201-1/+5
|
* gh-111956: Add thread-safe one-time initialization. (gh-111960)Sam Gross2023-11-161-47/+42
|
* gh-106905: avoid incorrect SystemError about recursion depth mismatch (#106906)Markus Mohrhard2023-11-131-0/+1
| | | | | | | | | | * gh-106905: avoid incorrect SystemError about recursion depth mismatch * Update Misc/NEWS.d/next/Core and Builtins/2023-07-20-11-41-16.gh-issue-106905.AyZpuB.rst --------- Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com> Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* Simplify _PyPegen_join_names_with_dot() (GH-111602)Serhiy Storchaka2023-11-011-32/+2
|
* gh-111420: Allow type comments in parenthesized `with` statements (#111468)Tomas R2023-10-311-6/+9
|
* gh-111380: Show SyntaxWarnings only once when parsing if invalid syntax is ↵Pablo Galindo Salgado2023-10-271-0/+5
| | | | encouintered (#111381)
* gh-100445: Improve error message for unterminated strings with escapes (#100446)Shantanu2023-10-181-2/+16
|
* gh-110938: Fix error messages for indented blocks with functions and classes ↵Pablo Galindo Salgado2023-10-171-19/+31
| | | | with generic type parameters (#110973)
* gh-107450: Remove unnecessary overflow check in parser error handler (#110940)Lysandros Nikolaou2023-10-161-6/+0
|
* gh-107450: Check for overflow in the tokenizer and fix overflow test (#110832)Lysandros Nikolaou2023-10-162-0/+9
| | | | Co-authored-by: Filipe Laíns <lains@riseup.net> Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* gh-110805: Allow the repl to show source code and complete tracebacks (#110775)Pablo Galindo Salgado2023-10-133-3/+27
|
* gh-107450: Raise OverflowError when parser column offset overflows (#110754)Lysandros Nikolaou2023-10-121-0/+6
|
* gh-110696: Fix incorrect syntax error message for incorrect argument ↵Pablo Galindo Salgado2023-10-121-1133/+1485
| | | | unpacking (#110706)
* gh-104169: Fix test_peg_generator after tokenizer refactoring (#110727)Lysandros Nikolaou2023-10-122-4/+5
| | | | * Fix test_peg_generator after tokenizer refactoring * Remove references to tokenizer.c in comments etc.
* GH-110749: fix unistd.h import in file_tokenizer.c (#110750)Filipe Laíns2023-10-121-4/+4
|
* gh-104169: Refactor tokenizer into lexer and wrappers (#110684)Lysandros Nikolaou2023-10-1119-2978/+3075
| | | | | | | | | | | * The lexer, which include the actual lexeme producing logic, goes into the `lexer` directory. * The wrappers, one wrapper per input mode (file, string, utf-8, and readline), go into the `tokenizer` directory and include logic for creating a lexer instance and managing the buffer for different modes. --------- Co-authored-by: Pablo Galindo <pablogsal@gmail.com> Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
* gh-110309: Prune empty constant in format specs (#110320)sunmy20192023-10-051-10/+30
| | | Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
* gh-110259: Fix f-strings with multiline expressions and format specs (#110271)Pablo Galindo Salgado2023-10-051-6/+18
| | | Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
* gh-110014: Include explicitly <unistd.h> header (#110155)Victor Stinner2023-09-302-4/+10
| | | | | | | | | | | * Remove unused <locale.h> includes. * Remove unused <fcntl.h> include in traceback.h. * Remove redundant <assert.h> and <stddef.h> includes. They are already included by "Python.h". * Remove <object.h> include in faulthandler.c. Python.h already includes it. * Add missing <stdbool.h> in pycore_pythread.h if HAVE_PTHREAD_STUBS is defined. * Fix also warnings in pthread_stubs.h: don't redefine macros if they are already defined, like the __NEED_pthread_t macro.
* gh-109596: Ensure repeated rules in the grammar are not allowed and fix ↵Pablo Galindo Salgado2023-09-222-1208/+1180
| | | | incorrect soft keywords (#109606)
* gh-109114: Relax the check for invalid lambdas inside f-strings to avoid ↵Pablo Galindo Salgado2023-09-081-1124/+1065
| | | | false positives (#109121)
* GH-91079: Rename C_RECURSION_LIMIT to Py_C_RECURSION_LIMIT (#108507)Victor Stinner2023-09-081-2/+2
| | | | | | | Symbols of the C API should be prefixed by "Py_" to avoid conflict with existing names in 3rd party C extensions on "#include <Python.h>". test.pythoninfo now logs Py_C_RECURSION_LIMIT constant and other _testcapi and _testinternalcapi constants.
* gh-88943: Improve syntax error for non-ASCII character that follows a ↵Serhiy Storchaka2023-09-071-1/+1
| | | | | numerical literal (GH-109081) It now points on the invalid non-ASCII character, not on the valid numerical literal.
* gh-108767: Replace ctype.h functions with pyctype.h functions (#108772)Victor Stinner2023-09-011-19/+18
| | | | | | | | | | | | | | Replace <ctype.h> locale dependent functions with Python "pyctype.h" locale independent functions: * Replace isalpha() with Py_ISALPHA(). * Replace isdigit() with Py_ISDIGIT(). * Replace isxdigit() with Py_ISXDIGIT(). * Replace tolower() with Py_TOLOWER(). Leave Modules/_sre/sre.c unchanged, it uses locale dependent functions on purpose. Include explicitly <ctype.h> in _decimal.c to get isascii().
* gh-108444: Remove _PyLong_AsInt() function (#108461)Victor Stinner2023-08-251-1/+1
| | | | * Update Parser/asdl_c.py to regenerate Python/Python-ast.c. * Remove _PyLong_AsInt() alias to PyLong_AsInt().
* gh-108179: Add error message for parser stack overflows (#108256)Dennis Sweeney2023-08-223-1060/+540
|
* gh-108216: Cleanup #include in internal header files (#108228)Victor Stinner2023-08-211-1/+1
| | | | | | | | | | | * Add missing includes. * Remove unused includes. * Update old include/symbol names to newer names. * Mention at least one included symbol. * Sort includes. * Update Tools/cases_generator/generate_cases.py used to generated pycore_opcode_metadata.h. * Update Parser/asdl_c.py used to generate pycore_ast.h. * Cleanup also includes in _testcapimodule.c and _testinternalcapi.c.
* gh-108113: Make it possible to create an optimized AST (#108154)Irit Katriel2023-08-211-0/+3
|
* gh-107967: Fix infinite recursion on invalid escape sequence warning (#107968)Lysandros Nikolaou2023-08-151-0/+3
|
* GH-107263: Increase C stack limit for most functions, except ↵Mark Shannon2023-08-041-1/+1
| | | | | | `_PyEval_EvalFrameDefault()` (GH-107535) * Set C recursion limit to 1500, set cost of eval loop to 2 frames, and compiler mutliply to 2.