summaryrefslogtreecommitdiffstats
path: root/Parser/string_parser.c
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2021-04-07 19:34:22 (GMT)
committerGitHub <noreply@github.com>2021-04-07 19:34:22 (GMT)
commitd27f8d2e07d31670af469ef387a37bc9e96ea8ad (patch)
treedbcf728b4340011a6c87ff75f59352599eaba6b8 /Parser/string_parser.c
parent58d72cab89cf9652acc0bf0007aa20b2bcc98499 (diff)
downloadcpython-d27f8d2e07d31670af469ef387a37bc9e96ea8ad.zip
cpython-d27f8d2e07d31670af469ef387a37bc9e96ea8ad.tar.gz
cpython-d27f8d2e07d31670af469ef387a37bc9e96ea8ad.tar.bz2
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.
Diffstat (limited to 'Parser/string_parser.c')
-rw-r--r--Parser/string_parser.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/Parser/string_parser.c b/Parser/string_parser.c
index 6a1a395..b919633 100644
--- a/Parser/string_parser.c
+++ b/Parser/string_parser.c
@@ -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);