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

Change ExtendsClause to manyTerm (typeReference <|> expression)

This commit is contained in:
joshvera 2017-10-31 10:41:55 -04:00
parent 06f2b2e0df
commit 562d493ccf
2 changed files with 5 additions and 2 deletions

View File

@ -288,7 +288,10 @@ classHeritage' :: HasCallStack => Assignment.Assignment [] Grammar [Term]
classHeritage' = symbol Grammar.ClassHeritage *> children (((++) `on` toList) <$> optional (term extendsClause) <*> optional (term implementsClause'))
extendsClause :: Assignment
extendsClause = makeTerm <$> symbol Grammar.ExtendsClause <*> children (TypeScript.Syntax.ExtendsClause <$> term (expression <|> typeIdentifier) <*> (term typeArguments' <|> emptyTerm))
extendsClause = makeTerm <$> symbol Grammar.ExtendsClause <*> children (TypeScript.Syntax.ExtendsClause <$> manyTerm (typeReference <|> expression))
typeReference :: Assignment
typeReference = typeIdentifier <|> nestedTypeIdentifier <|> genericType
implementsClause' :: Assignment
implementsClause' = makeTerm <$> symbol Grammar.ImplementsClause <*> children (TypeScript.Syntax.ImplementsClause <$> manyTerm ty)

View File

@ -228,7 +228,7 @@ instance Eq1 EnumDeclaration where liftEq = genericLiftEq
instance Ord1 EnumDeclaration where liftCompare = genericLiftCompare
instance Show1 EnumDeclaration where liftShowsPrec = genericLiftShowsPrec
data ExtendsClause a = ExtendsClause { _extendsSubject :: a, _extendsTypeArguments :: a }
data ExtendsClause a = ExtendsClause { _extendsClauses :: [a] }
deriving (Diffable, Eq, Foldable, Functor, GAlign, Generic1, Mergeable, Ord, Show, Traversable)
instance Eq1 ExtendsClause where liftEq = genericLiftEq