1
1
mirror of https://github.com/github/semantic.git synced 2024-11-28 01:47:01 +03:00

Assign FutureImportStatements

This commit is contained in:
Rick Winfrey 2018-08-10 10:10:40 -07:00
parent 2adbbdec2b
commit bdc0daa7ba

View File

@ -409,6 +409,7 @@ comment = makeTerm <$> symbol Comment <*> (Comment.Comment <$> source)
import' :: Assignment Term
import' = makeTerm'' <$> symbol ImportStatement <*> children (manyTerm (aliasedImport <|> plainImport))
<|> makeTerm <$> symbol ImportFromStatement <*> children (Python.Syntax.Import <$> importPath <*> (wildcard <|> some (aliasImportSymbol <|> importSymbol)))
<|> makeTerm <$> symbol FutureImportStatement <*> children (Python.Syntax.FutureImport <$> some (aliasImportSymbol <|> importSymbol))
where
-- `import a as b`
aliasedImport = makeTerm <$> symbol AliasedImport <*> children (Python.Syntax.QualifiedAliasedImport <$> importPath <*> expression)