bpo-43798: Add source location attributes to alias (GH-25324)
* Add source location attributes to alias.
* Move alias star construction to pegen helper.
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
diff --git a/Parser/pegen.c b/Parser/pegen.c
index 57759f7..f841ace 100644
--- a/Parser/pegen.c
+++ b/Parser/pegen.c
@@ -1555,8 +1555,8 @@
/* Creates an alias with '*' as the identifier name */
alias_ty
-_PyPegen_alias_for_star(Parser *p)
-{
+_PyPegen_alias_for_star(Parser *p, int lineno, int col_offset, int end_lineno,
+ int end_col_offset, PyArena *arena) {
PyObject *str = PyUnicode_InternFromString("*");
if (!str) {
return NULL;
@@ -1565,7 +1565,7 @@
Py_DECREF(str);
return NULL;
}
- return _PyAST_alias(str, NULL, p->arena);
+ return _PyAST_alias(str, NULL, lineno, col_offset, end_lineno, end_col_offset, arena);
}
/* Creates a new asdl_seq* with the identifiers of all the names in seq */