mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
bpo-43244: Rename pycore_ast.h functions to _PyAST_xxx() (GH-25252)
Rename AST functions of pycore_ast.h to use the "_PyAST_" prefix. Remove macros creating aliases without prefix. For example, Module() becomes _PyAST_Module(). Update Grammar/python.gram to use _PyAST_xxx() functions.
This commit is contained in:
parent
58d72cab89
commit
d27f8d2e07
9 changed files with 858 additions and 907 deletions
|
@ -797,10 +797,11 @@ fstring_find_expr(Parser *p, const char **str, const char *end, int raw, int rec
|
|||
/* And now create the FormattedValue node that represents this
|
||||
entire expression with the conversion and format spec. */
|
||||
//TODO: Fix this
|
||||
*expression = FormattedValue(simple_expression, conversion,
|
||||
format_spec, first_token->lineno,
|
||||
first_token->col_offset, last_token->end_lineno,
|
||||
last_token->end_col_offset, p->arena);
|
||||
*expression = _PyAST_FormattedValue(simple_expression, conversion,
|
||||
format_spec, first_token->lineno,
|
||||
first_token->col_offset,
|
||||
last_token->end_lineno,
|
||||
last_token->end_col_offset, p->arena);
|
||||
if (!*expression) {
|
||||
goto error;
|
||||
}
|
||||
|
@ -1044,8 +1045,9 @@ make_str_node_and_del(Parser *p, PyObject **str, Token* first_token, Token *last
|
|||
return NULL;
|
||||
}
|
||||
|
||||
return Constant(s, kind, first_token->lineno, first_token->col_offset,
|
||||
last_token->end_lineno, last_token->end_col_offset, p->arena);
|
||||
return _PyAST_Constant(s, kind, first_token->lineno, first_token->col_offset,
|
||||
last_token->end_lineno, last_token->end_col_offset,
|
||||
p->arena);
|
||||
|
||||
}
|
||||
|
||||
|
@ -1204,8 +1206,9 @@ _PyPegen_FstringParser_Finish(Parser *p, FstringParser *state, Token* first_toke
|
|||
goto error;
|
||||
}
|
||||
|
||||
return _Py_JoinedStr(seq, first_token->lineno, first_token->col_offset,
|
||||
last_token->end_lineno, last_token->end_col_offset, p->arena);
|
||||
return _PyAST_JoinedStr(seq, first_token->lineno, first_token->col_offset,
|
||||
last_token->end_lineno, last_token->end_col_offset,
|
||||
p->arena);
|
||||
|
||||
error:
|
||||
_PyPegen_FstringParser_Dealloc(state);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue