mirror of
https://github.com/github/semantic.git
synced 2024-12-29 01:42:43 +03:00
Assign aliased imports
This commit is contained in:
parent
c46a0bd615
commit
b35091f754
@ -124,6 +124,7 @@ statement = assertStatement
|
||||
<|> ifStatement
|
||||
<|> identifier
|
||||
<|> import'
|
||||
<|> importAlias
|
||||
<|> importFrom
|
||||
<|> nonlocalStatement
|
||||
<|> passStatement
|
||||
@ -354,6 +355,9 @@ import' = makeTerm <$> symbol ImportStatement <*> children (Declaration.Import <
|
||||
importFrom :: Assignment
|
||||
importFrom = makeTerm <$> symbol ImportFromStatement <*> children (Declaration.Import <$> many expression)
|
||||
|
||||
importAlias :: Assignment
|
||||
importAlias = makeTerm <$> symbol AliasedImport <*> children (flip Statement.Let <$> expression <*> expression <*> emptyTerm)
|
||||
|
||||
assertStatement :: Assignment
|
||||
assertStatement = makeTerm <$ symbol AssertStatement <*> location <*> children (Expression.Call <$> (makeTerm <$> symbol AnonAssert <*> (Syntax.Identifier <$> source)) <*> many expression)
|
||||
|
||||
|
4
test/fixtures/python/import-statement.A.py
vendored
4
test/fixtures/python/import-statement.A.py
vendored
@ -1,2 +1,2 @@
|
||||
import a, b
|
||||
import b.c as d
|
||||
import a, b as c
|
||||
import b.c as d, e
|
||||
|
Loading…
Reference in New Issue
Block a user