summaryrefslogtreecommitdiffstats
path: root/Parser
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* gh-107015: Remove async_hacks from the tokenizer (#107018)Pablo Galindo Salgado2023-07-266-402/+313
|
* gh-106869: Use new PyMemberDef constant names (#106871)Victor Stinner2023-07-251-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Remove '#include "structmember.h"'. * If needed, add <stddef.h> to get offsetof() function. * Update Parser/asdl_c.py to regenerate Python/Python-ast.c. * Replace: * T_SHORT => Py_T_SHORT * T_INT => Py_T_INT * T_LONG => Py_T_LONG * T_FLOAT => Py_T_FLOAT * T_DOUBLE => Py_T_DOUBLE * T_STRING => Py_T_STRING * T_OBJECT => _Py_T_OBJECT * T_CHAR => Py_T_CHAR * T_BYTE => Py_T_BYTE * T_UBYTE => Py_T_UBYTE * T_USHORT => Py_T_USHORT * T_UINT => Py_T_UINT * T_ULONG => Py_T_ULONG * T_STRING_INPLACE => Py_T_STRING_INPLACE * T_BOOL => Py_T_BOOL * T_OBJECT_EX => Py_T_OBJECT_EX * T_LONGLONG => Py_T_LONGLONG * T_ULONGLONG => Py_T_ULONGLONG * T_PYSSIZET => Py_T_PYSSIZET * T_NONE => _Py_T_NONE * READONLY => Py_READONLY * PY_AUDIT_READ => Py_AUDIT_READ * READ_RESTRICTED => Py_AUDIT_READ * PY_WRITE_RESTRICTED => _Py_WRITE_RESTRICTED * RESTRICTED => (READ_RESTRICTED | _Py_WRITE_RESTRICTED)
* gh-106320: Remove _PyBytes_Join() C API (#107144)Victor Stinner2023-07-231-0/+1
| | | | | | | | | | | Move private _PyBytes functions to the internal C API (pycore_bytesobject.h): * _PyBytes_DecodeEscape() * _PyBytes_FormatEx() * _PyBytes_FromHex() * _PyBytes_Join() No longer export these functions.
* gh-106320: Remove _PyOS_ReadlineTState API (#107034)Victor Stinner2023-07-221-1/+3
| | | | Remove _PyOS_ReadlineTState variable from the public C API. The symbol is still exported for the readline shared extension.
* gh-106989: Remove tok report warnings (#106993)Menelaos Kotoglou2023-07-222-6/+0
|
* gh-106521: Remove _PyObject_LookupAttr() function (GH-106642)Serhiy Storchaka2023-07-121-3/+3
|
* gh-106396: Special-case empty format spec to gen empty JoinedStr node (#106401)Lysandros Nikolaou2023-07-041-0/+12
|
* gh-106320: Remove private _PyUnicode codecs C API functions (#106385)Victor Stinner2023-07-041-0/+1
| | | | | Remove private _PyUnicode codecs C API functions: move them to the internal C API (pycore_unicodeobject.h). No longer export most of these functions.
* gh-106320: Remove private _PyErr C API functions (#106356)Victor Stinner2023-07-031-0/+1
| | | | Remove private _PyErr C API functions: move them to the internal C API (pycore_pyerrors.h).
* gh-104922: remove PY_SSIZE_T_CLEAN (#106315)Inada Naoki2023-07-022-2/+0
|
* gh-106145: Make `end_{lineno,col_offset}` required on `type_param` nodes ↵Nikita Sobolev2023-06-301-1/+1
| | | | (#106224)
* gh-106023: Update code using _PyObject_FastCall() (#106257)Victor Stinner2023-06-301-2/+2
| | | Replace _PyObject_FastCall() calls with PyObject_Vectorcall().
* gh-98931: Add custom error messages to invalid import/from with multiple ↵Pablo Galindo Salgado2023-06-221-596/+719
| | | | | | targets (#105985) Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>