mirror of
https://github.com/github/semantic.git
synced 2024-12-22 06:11:49 +03:00
Slightly different ordering for easy of construction
This commit is contained in:
parent
9ef05f5135
commit
05c1d5e0dc
@ -251,7 +251,7 @@ instance Show1 Comprehension where liftShowsPrec = genericLiftShowsPrec
|
||||
instance (MonadFail m) => Eval t v m Comprehension
|
||||
|
||||
-- | Import declarations.
|
||||
data Import a = Import { importFrom :: !a, importSymbols :: !a, importAlias :: !a }
|
||||
data Import a = Import { importFrom :: !a, importAlias :: !a, importSymbols :: !a }
|
||||
deriving (Diffable, Eq, Foldable, Functor, GAlign, Generic1, Mergeable, Ord, Show, Traversable, FreeVariables1)
|
||||
|
||||
instance Eq1 Import where liftEq = genericLiftEq
|
||||
|
@ -377,9 +377,9 @@ comment = makeTerm <$> symbol Comment <*> (Comment.Comment <$> source)
|
||||
|
||||
import' :: Assignment
|
||||
import' = mk <$> symbol ImportStatement <*> children (manyTerm (aliasedImport <|> plainImport))
|
||||
<|> makeTerm <$> symbol ImportFromStatement <*> children (Declaration.Import <$> expression <*> (wildCard <|> expressions) <*> emptyTerm)
|
||||
<|> makeTerm <$> symbol ImportFromStatement <*> children (Declaration.Import <$> expression <*> emptyTerm <*> (wildCard <|> expressions))
|
||||
where
|
||||
aliasedImport = makeTerm <$> symbol AliasedImport <*> children (Declaration.Import <$> expression <*> emptyTerm <*> expression)
|
||||
aliasedImport = makeTerm <$> symbol AliasedImport <*> children (Declaration.Import <$> expression <*> expression <*> emptyTerm)
|
||||
plainImport = makeTerm <$> symbol DottedName <*> children (Declaration.Import <$> expression <*> emptyTerm <*> emptyTerm)
|
||||
wildCard = makeTerm <$> symbol WildcardImport <*> (Syntax.Identifier <$> source)
|
||||
mk _ [child] = child
|
||||
|
Loading…
Reference in New Issue
Block a user