mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
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>
This commit is contained in:
parent
e05a703848
commit
75a06f067b
11 changed files with 199 additions and 19 deletions
|
@ -314,7 +314,7 @@ class TestCParser(TempdirManager, unittest.TestCase):
|
|||
)
|
||||
simple_name[expr_ty]: NAME
|
||||
import_as_names_from[asdl_alias_seq*]: a[asdl_alias_seq*]=','.import_as_name_from+ { a }
|
||||
import_as_name_from[alias_ty]: a=NAME 'as' b=NAME { _PyAST_alias(((expr_ty) a)->v.Name.id, ((expr_ty) b)->v.Name.id, p->arena) }
|
||||
import_as_name_from[alias_ty]: a=NAME 'as' b=NAME { _PyAST_alias(((expr_ty) a)->v.Name.id, ((expr_ty) b)->v.Name.id, EXTRA) }
|
||||
"""
|
||||
test_source = """
|
||||
for stmt in ("from a import b as c", "from . import a as b"):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue