1
1
mirror of https://github.com/github/semantic.git synced 2024-12-29 18:06:14 +03:00

Assign aliased imports

This commit is contained in:
Rick Winfrey 2017-07-10 15:58:41 -07:00
parent c46a0bd615
commit b35091f754
2 changed files with 6 additions and 2 deletions

View File

@ -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)

View File

@ -1,2 +1,2 @@
import a, b
import b.c as d
import a, b as c
import b.c as d, e