diff options
author | Matthew Suozzo <msuozzo@google.com> | 2021-04-10 20:56:28 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-10 20:56:28 (GMT) |
commit | 75a06f067bd0a2687312e5f8e78f9075be76ad3a (patch) | |
tree | a0bb72532b0579b5949a00b620c83049ae803f8c /Grammar/python.gram | |
parent | e05a703848473b0365886dcc593cbddc46609f29 (diff) | |
download | cpython-75a06f067bd0a2687312e5f8e78f9075be76ad3a.zip cpython-75a06f067bd0a2687312e5f8e78f9075be76ad3a.tar.gz cpython-75a06f067bd0a2687312e5f8e78f9075be76ad3a.tar.bz2 |
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>
Diffstat (limited to 'Grammar/python.gram')
-rw-r--r-- | Grammar/python.gram | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Grammar/python.gram b/Grammar/python.gram index ebf028f..eb10fc2 100644 --- a/Grammar/python.gram +++ b/Grammar/python.gram @@ -144,20 +144,20 @@ import_from[stmt_ty]: import_from_targets[asdl_alias_seq*]: | '(' a=import_from_as_names [','] ')' { a } | import_from_as_names !',' - | '*' { (asdl_alias_seq*)_PyPegen_singleton_seq(p, CHECK(alias_ty, _PyPegen_alias_for_star(p))) } + | '*' { (asdl_alias_seq*)_PyPegen_singleton_seq(p, CHECK(alias_ty, _PyPegen_alias_for_star(p, EXTRA))) } | invalid_import_from_targets import_from_as_names[asdl_alias_seq*]: | a[asdl_alias_seq*]=','.import_from_as_name+ { a } import_from_as_name[alias_ty]: | a=NAME b=['as' z=NAME { z }] { _PyAST_alias(a->v.Name.id, (b) ? ((expr_ty) b)->v.Name.id : NULL, - p->arena) } + EXTRA) } dotted_as_names[asdl_alias_seq*]: | a[asdl_alias_seq*]=','.dotted_as_name+ { a } dotted_as_name[alias_ty]: | a=dotted_name b=['as' z=NAME { z }] { _PyAST_alias(a->v.Name.id, (b) ? ((expr_ty) b)->v.Name.id : NULL, - p->arena) } + EXTRA) } dotted_name[expr_ty]: | a=dotted_name '.' b=NAME { _PyPegen_join_names_with_dot(p, a, b) } | NAME |