mirror of
https://github.com/python/cpython.git
synced 2025-12-31 04:23:37 +00:00
gh-131421: Fix ASDL kw_defaults being expr* instead of expr?* (GH-133773)
Also fix docs ASDL highlighting.
This commit is contained in:
parent
daa9aa4c0a
commit
f37f57dfe6
3 changed files with 3 additions and 3 deletions
|
|
@ -22,7 +22,7 @@ class ASDLLexer(RegexLexer):
|
|||
bygroups(Keyword, Text, Name.Tag),
|
||||
),
|
||||
(
|
||||
r"(\w+)(\*\s|\?\s|\s)(\w+)",
|
||||
r"(\w+)([\?\*]*\s)(\w+)",
|
||||
bygroups(Name.Builtin.Pseudo, Operator, Name),
|
||||
),
|
||||
# Keep in line with ``builtin_types`` from Parser/asdl.py.
|
||||
|
|
|
|||
|
|
@ -114,7 +114,7 @@ module Python
|
|||
attributes (int lineno, int col_offset, int? end_lineno, int? end_col_offset)
|
||||
|
||||
arguments = (arg* posonlyargs, arg* args, arg? vararg, arg* kwonlyargs,
|
||||
expr* kw_defaults, arg? kwarg, expr* defaults)
|
||||
expr?* kw_defaults, arg? kwarg, expr* defaults)
|
||||
|
||||
arg = (identifier arg, expr? annotation, string? type_comment)
|
||||
attributes (int lineno, int col_offset, int? end_lineno, int? end_col_offset)
|
||||
|
|
|
|||
2
Python/Python-ast.c
generated
2
Python/Python-ast.c
generated
|
|
@ -6813,7 +6813,7 @@ init_types(void *arg)
|
|||
return -1;
|
||||
state->arguments_type = make_type(state, "arguments", state->AST_type,
|
||||
arguments_fields, 7,
|
||||
"arguments(arg* posonlyargs, arg* args, arg? vararg, arg* kwonlyargs, expr* kw_defaults, arg? kwarg, expr* defaults)");
|
||||
"arguments(arg* posonlyargs, arg* args, arg? vararg, arg* kwonlyargs, expr?* kw_defaults, arg? kwarg, expr* defaults)");
|
||||
if (!state->arguments_type) return -1;
|
||||
if (add_attributes(state, state->arguments_type, NULL, 0) < 0) return -1;
|
||||
if (PyObject_SetAttr(state->arguments_type, state->vararg, Py_None) == -1)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue