Skip to content

[3.13] gh-130077: Properly match full soft keywords in the parser (GH-135317) #135399

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: 3.13
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Lib/test/test_syntax.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,13 @@
Traceback (most recent call last):
SyntaxError: invalid syntax

# But prefixes of soft keywords should
# still raise specialized errors

>>> (mat x)
Traceback (most recent call last):
SyntaxError: invalid syntax. Perhaps you forgot a comma?

From compiler_complex_args():

>>> def f(None=1):
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Properly raise custom syntax errors when incorrect syntax containing names
that are prefixes of soft keywords is encountered. Patch by Pablo Galindo.
2 changes: 2 additions & 0 deletions Parser/pegen.c
Original file line number Diff line number Diff line change
Expand Up @@ -609,6 +609,8 @@
Py_ssize_t size;
PyBytes_AsStringAndSize(t->bytes, &the_token, &size);
for (char **keyword = p->soft_keywords; *keyword != NULL; keyword++) {
if (strlen(*keyword) == (size_t)size &&
strncmp(*keyword, the_token, (size_t)size) == 0) {
if (strncmp(*keyword, the_token, size) == 0) {
return _PyPegen_name_from_token(p, t);
}
Expand All @@ -617,30 +619,30 @@
}

static PyObject *
parsenumber_raw(const char *s)

Check failure on line 622 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (ubuntu-24.04, 3.2.3)

invalid storage class for function ‘parsenumber_raw’

Check failure on line 622 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Ubuntu (free-threading) / build and test (ubuntu-24.04)

invalid storage class for function ‘parsenumber_raw’

Check failure on line 622 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (ubuntu-24.04, 3.3.2)

invalid storage class for function ‘parsenumber_raw’

Check failure on line 622 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Hypothesis tests on Ubuntu

invalid storage class for function ‘parsenumber_raw’

Check failure on line 622 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (ubuntu-24.04, 3.1.7)

invalid storage class for function ‘parsenumber_raw’

Check failure on line 622 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Ubuntu / build and test (ubuntu-24.04)

invalid storage class for function ‘parsenumber_raw’

Check failure on line 622 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (ubuntu-24.04, 3.0.15)

invalid storage class for function ‘parsenumber_raw’

Check failure on line 622 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Ubuntu (free-threading) / build and test (ubuntu-24.04-arm)

invalid storage class for function ‘parsenumber_raw’

Check failure on line 622 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Address sanitizer (ubuntu-24.04)

invalid storage class for function ‘parsenumber_raw’

Check failure on line 622 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Ubuntu / build and test (ubuntu-24.04-arm)

invalid storage class for function ‘parsenumber_raw’
{

Check failure on line 623 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Windows / build (arm64)

syntax error: missing ';' before '{' [D:\a\cpython\cpython\PCbuild\_freeze_module.vcxproj]

Check failure on line 623 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / build and test (x64)

syntax error: missing ';' before '{' [D:\a\cpython\cpython\PCbuild\_freeze_module.vcxproj]

Check failure on line 623 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / build (arm64)

syntax error: missing ';' before '{' [D:\a\cpython\cpython\PCbuild\_freeze_module.vcxproj]

Check failure on line 623 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Windows / build and test (x64)

syntax error: missing ';' before '{' [D:\a\cpython\cpython\PCbuild\_freeze_module.vcxproj]
const char *end;
long x;
double dx;
Py_complex compl;
int imflag;

assert(s != NULL);

Check warning on line 630 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Windows / build (arm64)

'!=': 'int' differs in levels of indirection from 'void *' [D:\a\cpython\cpython\PCbuild\_freeze_module.vcxproj]

Check failure on line 630 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Windows / build (arm64)

's': undeclared identifier [D:\a\cpython\cpython\PCbuild\_freeze_module.vcxproj]

Check warning on line 630 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / build and test (x64)

'!=': 'int' differs in levels of indirection from 'void *' [D:\a\cpython\cpython\PCbuild\_freeze_module.vcxproj]

Check failure on line 630 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / build and test (x64)

's': undeclared identifier [D:\a\cpython\cpython\PCbuild\_freeze_module.vcxproj]

Check warning on line 630 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / build (arm64)

'!=': 'int' differs in levels of indirection from 'void *' [D:\a\cpython\cpython\PCbuild\_freeze_module.vcxproj]

Check failure on line 630 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / build (arm64)

's': undeclared identifier [D:\a\cpython\cpython\PCbuild\_freeze_module.vcxproj]

Check warning on line 630 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Windows / build and test (x64)

'!=': 'int' differs in levels of indirection from 'void *' [D:\a\cpython\cpython\PCbuild\_freeze_module.vcxproj]

Check failure on line 630 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Windows / build and test (x64)

's': undeclared identifier [D:\a\cpython\cpython\PCbuild\_freeze_module.vcxproj]
errno = 0;
end = s + strlen(s) - 1;

Check warning on line 632 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Windows / build (arm64)

'=': 'const char *' differs in levels of indirection from 'size_t' [D:\a\cpython\cpython\PCbuild\_freeze_module.vcxproj]

Check warning on line 632 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Windows / build (arm64)

'strlen': different types for formal and actual parameter 1 [D:\a\cpython\cpython\PCbuild\_freeze_module.vcxproj]

Check warning on line 632 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Windows / build (arm64)

'function': 'const char *' differs in levels of indirection from 'int' [D:\a\cpython\cpython\PCbuild\_freeze_module.vcxproj]

Check failure on line 632 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Windows / build (arm64)

's': undeclared identifier [D:\a\cpython\cpython\PCbuild\_freeze_module.vcxproj]

Check failure on line 632 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Windows / build (arm64)

's': undeclared identifier [D:\a\cpython\cpython\PCbuild\_freeze_module.vcxproj]

Check warning on line 632 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / build and test (x64)

'=': 'const char *' differs in levels of indirection from 'size_t' [D:\a\cpython\cpython\PCbuild\_freeze_module.vcxproj]

Check warning on line 632 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / build and test (x64)

'strlen': different types for formal and actual parameter 1 [D:\a\cpython\cpython\PCbuild\_freeze_module.vcxproj]

Check warning on line 632 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / build and test (x64)

'function': 'const char *' differs in levels of indirection from 'int' [D:\a\cpython\cpython\PCbuild\_freeze_module.vcxproj]

Check failure on line 632 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / build and test (x64)

's': undeclared identifier [D:\a\cpython\cpython\PCbuild\_freeze_module.vcxproj]

Check failure on line 632 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / build and test (x64)

's': undeclared identifier [D:\a\cpython\cpython\PCbuild\_freeze_module.vcxproj]

Check warning on line 632 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / build (arm64)

'=': 'const char *' differs in levels of indirection from 'size_t' [D:\a\cpython\cpython\PCbuild\_freeze_module.vcxproj]

Check warning on line 632 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / build (arm64)

'strlen': different types for formal and actual parameter 1 [D:\a\cpython\cpython\PCbuild\_freeze_module.vcxproj]

Check warning on line 632 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / build (arm64)

'function': 'const char *' differs in levels of indirection from 'int' [D:\a\cpython\cpython\PCbuild\_freeze_module.vcxproj]

Check failure on line 632 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / build (arm64)

's': undeclared identifier [D:\a\cpython\cpython\PCbuild\_freeze_module.vcxproj]

Check failure on line 632 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / build (arm64)

's': undeclared identifier [D:\a\cpython\cpython\PCbuild\_freeze_module.vcxproj]

Check warning on line 632 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Windows / build and test (x64)

'=': 'const char *' differs in levels of indirection from 'size_t' [D:\a\cpython\cpython\PCbuild\_freeze_module.vcxproj]

Check warning on line 632 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Windows / build and test (x64)

'strlen': different types for formal and actual parameter 1 [D:\a\cpython\cpython\PCbuild\_freeze_module.vcxproj]

Check warning on line 632 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Windows / build and test (x64)

'function': 'const char *' differs in levels of indirection from 'int' [D:\a\cpython\cpython\PCbuild\_freeze_module.vcxproj]

Check failure on line 632 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Windows / build and test (x64)

's': undeclared identifier [D:\a\cpython\cpython\PCbuild\_freeze_module.vcxproj]

Check failure on line 632 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Windows / build and test (x64)

's': undeclared identifier [D:\a\cpython\cpython\PCbuild\_freeze_module.vcxproj]
imflag = *end == 'j' || *end == 'J';
if (s[0] == '0') {

Check failure on line 634 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Windows / build (arm64)

subscript requires array or pointer type [D:\a\cpython\cpython\PCbuild\_freeze_module.vcxproj]

Check failure on line 634 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Windows / build (arm64)

's': undeclared identifier [D:\a\cpython\cpython\PCbuild\_freeze_module.vcxproj]

Check failure on line 634 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / build and test (x64)

subscript requires array or pointer type [D:\a\cpython\cpython\PCbuild\_freeze_module.vcxproj]

Check failure on line 634 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / build and test (x64)

's': undeclared identifier [D:\a\cpython\cpython\PCbuild\_freeze_module.vcxproj]

Check failure on line 634 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / build (arm64)

subscript requires array or pointer type [D:\a\cpython\cpython\PCbuild\_freeze_module.vcxproj]

Check failure on line 634 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / build (arm64)

's': undeclared identifier [D:\a\cpython\cpython\PCbuild\_freeze_module.vcxproj]

Check failure on line 634 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Windows / build and test (x64)

subscript requires array or pointer type [D:\a\cpython\cpython\PCbuild\_freeze_module.vcxproj]

Check failure on line 634 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Windows / build and test (x64)

's': undeclared identifier [D:\a\cpython\cpython\PCbuild\_freeze_module.vcxproj]
x = (long)PyOS_strtoul(s, (char **)&end, 0);

Check warning on line 635 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Windows / build (arm64)

'PyOS_strtoul': different types for formal and actual parameter 1 [D:\a\cpython\cpython\PCbuild\_freeze_module.vcxproj]

Check warning on line 635 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Windows / build (arm64)

'function': 'const char *' differs in levels of indirection from 'int' [D:\a\cpython\cpython\PCbuild\_freeze_module.vcxproj]

Check failure on line 635 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Windows / build (arm64)

's': undeclared identifier [D:\a\cpython\cpython\PCbuild\_freeze_module.vcxproj]

Check warning on line 635 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / build and test (x64)

'PyOS_strtoul': different types for formal and actual parameter 1 [D:\a\cpython\cpython\PCbuild\_freeze_module.vcxproj]

Check warning on line 635 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / build and test (x64)

'function': 'const char *' differs in levels of indirection from 'int' [D:\a\cpython\cpython\PCbuild\_freeze_module.vcxproj]

Check failure on line 635 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / build and test (x64)

's': undeclared identifier [D:\a\cpython\cpython\PCbuild\_freeze_module.vcxproj]

Check warning on line 635 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / build (arm64)

'PyOS_strtoul': different types for formal and actual parameter 1 [D:\a\cpython\cpython\PCbuild\_freeze_module.vcxproj]

Check warning on line 635 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / build (arm64)

'function': 'const char *' differs in levels of indirection from 'int' [D:\a\cpython\cpython\PCbuild\_freeze_module.vcxproj]

Check failure on line 635 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / build (arm64)

's': undeclared identifier [D:\a\cpython\cpython\PCbuild\_freeze_module.vcxproj]

Check warning on line 635 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Windows / build and test (x64)

'PyOS_strtoul': different types for formal and actual parameter 1 [D:\a\cpython\cpython\PCbuild\_freeze_module.vcxproj]

Check warning on line 635 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Windows / build and test (x64)

'function': 'const char *' differs in levels of indirection from 'int' [D:\a\cpython\cpython\PCbuild\_freeze_module.vcxproj]

Check failure on line 635 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Windows / build and test (x64)

's': undeclared identifier [D:\a\cpython\cpython\PCbuild\_freeze_module.vcxproj]
if (x < 0 && errno == 0) {
return PyLong_FromString(s, (char **)0, 0);

Check warning on line 637 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Windows / build (arm64)

'return': incompatible types - from 'PyObject *' to 'expr_ty' [D:\a\cpython\cpython\PCbuild\_freeze_module.vcxproj]

Check warning on line 637 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Windows / build (arm64)

'PyLong_FromString': different types for formal and actual parameter 1 [D:\a\cpython\cpython\PCbuild\_freeze_module.vcxproj]

Check warning on line 637 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Windows / build (arm64)

'function': 'const char *' differs in levels of indirection from 'int' [D:\a\cpython\cpython\PCbuild\_freeze_module.vcxproj]

Check failure on line 637 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Windows / build (arm64)

's': undeclared identifier [D:\a\cpython\cpython\PCbuild\_freeze_module.vcxproj]

Check warning on line 637 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / build and test (x64)

'return': incompatible types - from 'PyObject *' to 'expr_ty' [D:\a\cpython\cpython\PCbuild\_freeze_module.vcxproj]

Check warning on line 637 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / build and test (x64)

'PyLong_FromString': different types for formal and actual parameter 1 [D:\a\cpython\cpython\PCbuild\_freeze_module.vcxproj]

Check warning on line 637 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / build and test (x64)

'function': 'const char *' differs in levels of indirection from 'int' [D:\a\cpython\cpython\PCbuild\_freeze_module.vcxproj]

Check failure on line 637 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / build and test (x64)

's': undeclared identifier [D:\a\cpython\cpython\PCbuild\_freeze_module.vcxproj]

Check warning on line 637 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / build (arm64)

'return': incompatible types - from 'PyObject *' to 'expr_ty' [D:\a\cpython\cpython\PCbuild\_freeze_module.vcxproj]

Check warning on line 637 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / build (arm64)

'PyLong_FromString': different types for formal and actual parameter 1 [D:\a\cpython\cpython\PCbuild\_freeze_module.vcxproj]

Check warning on line 637 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / build (arm64)

'function': 'const char *' differs in levels of indirection from 'int' [D:\a\cpython\cpython\PCbuild\_freeze_module.vcxproj]

Check failure on line 637 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / build (arm64)

's': undeclared identifier [D:\a\cpython\cpython\PCbuild\_freeze_module.vcxproj]

Check warning on line 637 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Windows / build and test (x64)

'return': incompatible types - from 'PyObject *' to 'expr_ty' [D:\a\cpython\cpython\PCbuild\_freeze_module.vcxproj]

Check warning on line 637 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Windows / build and test (x64)

'PyLong_FromString': different types for formal and actual parameter 1 [D:\a\cpython\cpython\PCbuild\_freeze_module.vcxproj]

Check warning on line 637 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Windows / build and test (x64)

'function': 'const char *' differs in levels of indirection from 'int' [D:\a\cpython\cpython\PCbuild\_freeze_module.vcxproj]

Check failure on line 637 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Windows / build and test (x64)

's': undeclared identifier [D:\a\cpython\cpython\PCbuild\_freeze_module.vcxproj]
}
}
else {
x = PyOS_strtol(s, (char **)&end, 0);

Check warning on line 641 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Windows / build (arm64)

'function': 'const char *' differs in levels of indirection from 'int' [D:\a\cpython\cpython\PCbuild\_freeze_module.vcxproj]

Check failure on line 641 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Windows / build (arm64)

's': undeclared identifier [D:\a\cpython\cpython\PCbuild\_freeze_module.vcxproj]

Check warning on line 641 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / build and test (x64)

'function': 'const char *' differs in levels of indirection from 'int' [D:\a\cpython\cpython\PCbuild\_freeze_module.vcxproj]

Check failure on line 641 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / build and test (x64)

's': undeclared identifier [D:\a\cpython\cpython\PCbuild\_freeze_module.vcxproj]

Check warning on line 641 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / build (arm64)

'function': 'const char *' differs in levels of indirection from 'int' [D:\a\cpython\cpython\PCbuild\_freeze_module.vcxproj]

Check failure on line 641 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / build (arm64)

's': undeclared identifier [D:\a\cpython\cpython\PCbuild\_freeze_module.vcxproj]

Check warning on line 641 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Windows / build and test (x64)

'function': 'const char *' differs in levels of indirection from 'int' [D:\a\cpython\cpython\PCbuild\_freeze_module.vcxproj]

Check failure on line 641 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Windows / build and test (x64)

's': undeclared identifier [D:\a\cpython\cpython\PCbuild\_freeze_module.vcxproj]
}
if (*end == '\0') {
if (errno != 0) {
return PyLong_FromString(s, (char **)0, 0);

Check failure on line 645 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Windows / build (arm64)

's': undeclared identifier [D:\a\cpython\cpython\PCbuild\_freeze_module.vcxproj]

Check failure on line 645 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / build and test (x64)

's': undeclared identifier [D:\a\cpython\cpython\PCbuild\_freeze_module.vcxproj]

Check failure on line 645 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / build (arm64)

's': undeclared identifier [D:\a\cpython\cpython\PCbuild\_freeze_module.vcxproj]

Check failure on line 645 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Windows / build and test (x64)

's': undeclared identifier [D:\a\cpython\cpython\PCbuild\_freeze_module.vcxproj]
}
return PyLong_FromLong(x);
}
Expand All @@ -661,7 +663,7 @@
}

static PyObject *
parsenumber(const char *s)

Check failure on line 666 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (ubuntu-24.04, 3.2.3)

invalid storage class for function ‘parsenumber’

Check failure on line 666 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Ubuntu (free-threading) / build and test (ubuntu-24.04)

invalid storage class for function ‘parsenumber’

Check failure on line 666 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (ubuntu-24.04, 3.3.2)

invalid storage class for function ‘parsenumber’

Check failure on line 666 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Hypothesis tests on Ubuntu

invalid storage class for function ‘parsenumber’

Check failure on line 666 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (ubuntu-24.04, 3.1.7)

invalid storage class for function ‘parsenumber’

Check failure on line 666 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Ubuntu / build and test (ubuntu-24.04)

invalid storage class for function ‘parsenumber’

Check failure on line 666 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (ubuntu-24.04, 3.0.15)

invalid storage class for function ‘parsenumber’

Check failure on line 666 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Ubuntu (free-threading) / build and test (ubuntu-24.04-arm)

invalid storage class for function ‘parsenumber’

Check failure on line 666 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Address sanitizer (ubuntu-24.04)

invalid storage class for function ‘parsenumber’

Check failure on line 666 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Ubuntu / build and test (ubuntu-24.04-arm)

invalid storage class for function ‘parsenumber’
{
char *dup;
char *end;
Expand Down Expand Up @@ -690,7 +692,7 @@
}

expr_ty
_PyPegen_number_token(Parser *p)

Check warning on line 695 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (ubuntu-24.04, 3.2.3)

‘_PyPegen_number_token’ defined but not used [-Wunused-function]

Check warning on line 695 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Ubuntu (free-threading) / build and test (ubuntu-24.04)

‘_PyPegen_number_token’ defined but not used [-Wunused-function]

Check warning on line 695 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (ubuntu-24.04, 3.3.2)

‘_PyPegen_number_token’ defined but not used [-Wunused-function]

Check warning on line 695 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Hypothesis tests on Ubuntu

‘_PyPegen_number_token’ defined but not used [-Wunused-function]

Check warning on line 695 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (ubuntu-24.04, 3.1.7)

‘_PyPegen_number_token’ defined but not used [-Wunused-function]

Check warning on line 695 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Ubuntu / build and test (ubuntu-24.04)

‘_PyPegen_number_token’ defined but not used [-Wunused-function]

Check warning on line 695 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (ubuntu-24.04, 3.0.15)

‘_PyPegen_number_token’ defined but not used [-Wunused-function]

Check warning on line 695 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Ubuntu (free-threading) / build and test (ubuntu-24.04-arm)

‘_PyPegen_number_token’ defined but not used [-Wunused-function]

Check warning on line 695 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Address sanitizer (ubuntu-24.04)

‘_PyPegen_number_token’ defined but not used [-Wunused-function]

Check warning on line 695 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Ubuntu / build and test (ubuntu-24.04-arm)

‘_PyPegen_number_token’ defined but not used [-Wunused-function]
{
Token *t = _PyPegen_expect_token(p, NUMBER);
if (t == NULL) {
Expand Down Expand Up @@ -749,7 +751,7 @@
statement by looking at what is left in the buffer after parsing.
Trailing whitespace and comments are OK. */
static int // bool
bad_single_statement(Parser *p)

Check failure on line 754 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (ubuntu-24.04, 3.2.3)

invalid storage class for function ‘bad_single_statement’

Check failure on line 754 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Ubuntu (free-threading) / build and test (ubuntu-24.04)

invalid storage class for function ‘bad_single_statement’

Check failure on line 754 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (ubuntu-24.04, 3.3.2)

invalid storage class for function ‘bad_single_statement’

Check failure on line 754 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Hypothesis tests on Ubuntu

invalid storage class for function ‘bad_single_statement’

Check failure on line 754 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (ubuntu-24.04, 3.1.7)

invalid storage class for function ‘bad_single_statement’

Check failure on line 754 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Ubuntu / build and test (ubuntu-24.04)

invalid storage class for function ‘bad_single_statement’

Check failure on line 754 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (ubuntu-24.04, 3.0.15)

invalid storage class for function ‘bad_single_statement’

Check failure on line 754 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Ubuntu (free-threading) / build and test (ubuntu-24.04-arm)

invalid storage class for function ‘bad_single_statement’

Check failure on line 754 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Address sanitizer (ubuntu-24.04)

invalid storage class for function ‘bad_single_statement’

Check failure on line 754 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Ubuntu / build and test (ubuntu-24.04-arm)

invalid storage class for function ‘bad_single_statement’
{
char *cur = p->tok->cur;
char c = *cur;
Expand All @@ -775,7 +777,7 @@
}

static int
compute_parser_flags(PyCompilerFlags *flags)

Check failure on line 780 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (ubuntu-24.04, 3.2.3)

invalid storage class for function ‘compute_parser_flags’

Check failure on line 780 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Ubuntu (free-threading) / build and test (ubuntu-24.04)

invalid storage class for function ‘compute_parser_flags’

Check failure on line 780 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (ubuntu-24.04, 3.3.2)

invalid storage class for function ‘compute_parser_flags’

Check failure on line 780 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Hypothesis tests on Ubuntu

invalid storage class for function ‘compute_parser_flags’

Check failure on line 780 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (ubuntu-24.04, 3.1.7)

invalid storage class for function ‘compute_parser_flags’

Check failure on line 780 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Ubuntu / build and test (ubuntu-24.04)

invalid storage class for function ‘compute_parser_flags’

Check failure on line 780 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (ubuntu-24.04, 3.0.15)

invalid storage class for function ‘compute_parser_flags’

Check failure on line 780 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Ubuntu (free-threading) / build and test (ubuntu-24.04-arm)

invalid storage class for function ‘compute_parser_flags’

Check failure on line 780 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Address sanitizer (ubuntu-24.04)

invalid storage class for function ‘compute_parser_flags’

Check failure on line 780 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Ubuntu / build and test (ubuntu-24.04-arm)

invalid storage class for function ‘compute_parser_flags’
{
int parser_flags = 0;
if (!flags) {
Expand Down Expand Up @@ -870,7 +872,7 @@
}

static void
reset_parser_state_for_error_pass(Parser *p)

Check failure on line 875 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (ubuntu-24.04, 3.2.3)

invalid storage class for function ‘reset_parser_state_for_error_pass’

Check failure on line 875 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Ubuntu (free-threading) / build and test (ubuntu-24.04)

invalid storage class for function ‘reset_parser_state_for_error_pass’

Check failure on line 875 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (ubuntu-24.04, 3.3.2)

invalid storage class for function ‘reset_parser_state_for_error_pass’

Check failure on line 875 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Hypothesis tests on Ubuntu

invalid storage class for function ‘reset_parser_state_for_error_pass’

Check failure on line 875 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (ubuntu-24.04, 3.1.7)

invalid storage class for function ‘reset_parser_state_for_error_pass’

Check failure on line 875 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Ubuntu / build and test (ubuntu-24.04)

invalid storage class for function ‘reset_parser_state_for_error_pass’

Check failure on line 875 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (ubuntu-24.04, 3.0.15)

invalid storage class for function ‘reset_parser_state_for_error_pass’

Check failure on line 875 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Ubuntu (free-threading) / build and test (ubuntu-24.04-arm)

invalid storage class for function ‘reset_parser_state_for_error_pass’

Check failure on line 875 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Address sanitizer (ubuntu-24.04)

invalid storage class for function ‘reset_parser_state_for_error_pass’

Check failure on line 875 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Ubuntu / build and test (ubuntu-24.04-arm)

invalid storage class for function ‘reset_parser_state_for_error_pass’
{
for (int i = 0; i < p->fill; i++) {
p->tokens[i]->memo = NULL;
Expand All @@ -883,7 +885,7 @@
}

static inline int
_is_end_of_source(Parser *p) {

Check failure on line 888 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (ubuntu-24.04, 3.2.3)

invalid storage class for function ‘_is_end_of_source’

Check failure on line 888 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Ubuntu (free-threading) / build and test (ubuntu-24.04)

invalid storage class for function ‘_is_end_of_source’

Check failure on line 888 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (ubuntu-24.04, 3.3.2)

invalid storage class for function ‘_is_end_of_source’

Check failure on line 888 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Hypothesis tests on Ubuntu

invalid storage class for function ‘_is_end_of_source’

Check failure on line 888 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (ubuntu-24.04, 3.1.7)

invalid storage class for function ‘_is_end_of_source’

Check failure on line 888 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Ubuntu / build and test (ubuntu-24.04)

invalid storage class for function ‘_is_end_of_source’

Check failure on line 888 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (ubuntu-24.04, 3.0.15)

invalid storage class for function ‘_is_end_of_source’

Check failure on line 888 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Ubuntu (free-threading) / build and test (ubuntu-24.04-arm)

invalid storage class for function ‘_is_end_of_source’

Check failure on line 888 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Address sanitizer (ubuntu-24.04)

invalid storage class for function ‘_is_end_of_source’

Check failure on line 888 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Ubuntu / build and test (ubuntu-24.04-arm)

invalid storage class for function ‘_is_end_of_source’
int err = p->tok->done;
return err == E_EOF || err == E_EOFS || err == E_EOLS;
}
Expand Down Expand Up @@ -934,7 +936,7 @@
}

mod_ty
_PyPegen_run_parser_from_file_pointer(FILE *fp, int start_rule, PyObject *filename_ob,

Check warning on line 939 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (ubuntu-24.04, 3.2.3)

‘_PyPegen_run_parser_from_file_pointer’ defined but not used [-Wunused-function]

Check warning on line 939 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Ubuntu (free-threading) / build and test (ubuntu-24.04)

‘_PyPegen_run_parser_from_file_pointer’ defined but not used [-Wunused-function]

Check warning on line 939 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (ubuntu-24.04, 3.3.2)

‘_PyPegen_run_parser_from_file_pointer’ defined but not used [-Wunused-function]

Check warning on line 939 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Hypothesis tests on Ubuntu

‘_PyPegen_run_parser_from_file_pointer’ defined but not used [-Wunused-function]

Check warning on line 939 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (ubuntu-24.04, 3.1.7)

‘_PyPegen_run_parser_from_file_pointer’ defined but not used [-Wunused-function]

Check warning on line 939 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Ubuntu / build and test (ubuntu-24.04)

‘_PyPegen_run_parser_from_file_pointer’ defined but not used [-Wunused-function]

Check warning on line 939 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (ubuntu-24.04, 3.0.15)

‘_PyPegen_run_parser_from_file_pointer’ defined but not used [-Wunused-function]

Check warning on line 939 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Ubuntu (free-threading) / build and test (ubuntu-24.04-arm)

‘_PyPegen_run_parser_from_file_pointer’ defined but not used [-Wunused-function]

Check warning on line 939 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Address sanitizer (ubuntu-24.04)

‘_PyPegen_run_parser_from_file_pointer’ defined but not used [-Wunused-function]

Check warning on line 939 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Ubuntu / build and test (ubuntu-24.04-arm)

‘_PyPegen_run_parser_from_file_pointer’ defined but not used [-Wunused-function]
const char *enc, const char *ps1, const char *ps2,
PyCompilerFlags *flags, int *errcode,
PyObject **interactive_src, PyArena *arena)
Expand Down Expand Up @@ -982,7 +984,7 @@
}

mod_ty
_PyPegen_run_parser_from_string(const char *str, int start_rule, PyObject *filename_ob,

Check warning on line 987 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (ubuntu-24.04, 3.2.3)

‘_PyPegen_run_parser_from_string’ defined but not used [-Wunused-function]

Check warning on line 987 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Ubuntu (free-threading) / build and test (ubuntu-24.04)

‘_PyPegen_run_parser_from_string’ defined but not used [-Wunused-function]

Check warning on line 987 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (ubuntu-24.04, 3.3.2)

‘_PyPegen_run_parser_from_string’ defined but not used [-Wunused-function]

Check warning on line 987 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Hypothesis tests on Ubuntu

‘_PyPegen_run_parser_from_string’ defined but not used [-Wunused-function]

Check warning on line 987 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (ubuntu-24.04, 3.1.7)

‘_PyPegen_run_parser_from_string’ defined but not used [-Wunused-function]

Check warning on line 987 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Ubuntu / build and test (ubuntu-24.04)

‘_PyPegen_run_parser_from_string’ defined but not used [-Wunused-function]

Check warning on line 987 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (ubuntu-24.04, 3.0.15)

‘_PyPegen_run_parser_from_string’ defined but not used [-Wunused-function]

Check warning on line 987 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Ubuntu (free-threading) / build and test (ubuntu-24.04-arm)

‘_PyPegen_run_parser_from_string’ defined but not used [-Wunused-function]

Check warning on line 987 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Address sanitizer (ubuntu-24.04)

‘_PyPegen_run_parser_from_string’ defined but not used [-Wunused-function]

Check warning on line 987 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Ubuntu / build and test (ubuntu-24.04-arm)

‘_PyPegen_run_parser_from_string’ defined but not used [-Wunused-function]
PyCompilerFlags *flags, PyArena *arena)
{
int exec_input = start_rule == Py_file_input;
Expand Down Expand Up @@ -1020,4 +1022,4 @@
error:
_PyTokenizer_Free(tok);
return result;
}

Check failure on line 1025 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (ubuntu-24.04, 3.2.3)

expected declaration or statement at end of input

Check failure on line 1025 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Ubuntu (free-threading) / build and test (ubuntu-24.04)

expected declaration or statement at end of input

Check failure on line 1025 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (ubuntu-24.04, 3.3.2)

expected declaration or statement at end of input

Check failure on line 1025 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Hypothesis tests on Ubuntu

expected declaration or statement at end of input

Check failure on line 1025 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (ubuntu-24.04, 3.1.7)

expected declaration or statement at end of input

Check failure on line 1025 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Ubuntu / build and test (ubuntu-24.04)

expected declaration or statement at end of input

Check failure on line 1025 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (ubuntu-24.04, 3.0.15)

expected declaration or statement at end of input

Check failure on line 1025 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Ubuntu (free-threading) / build and test (ubuntu-24.04-arm)

expected declaration or statement at end of input

Check failure on line 1025 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Address sanitizer (ubuntu-24.04)

expected declaration or statement at end of input

Check failure on line 1025 in Parser/pegen.c

View workflow job for this annotation

GitHub Actions / Ubuntu / build and test (ubuntu-24.04-arm)

expected declaration or statement at end of input
Loading