From 562d493ccf6ac10978497d47adabc86aa327f108 Mon Sep 17 00:00:00 2001 From: joshvera Date: Tue, 31 Oct 2017 10:41:55 -0400 Subject: [PATCH] Change ExtendsClause to manyTerm (typeReference <|> expression) --- src/Language/TypeScript/Assignment.hs | 5 ++++- src/Language/TypeScript/Syntax.hs | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Language/TypeScript/Assignment.hs b/src/Language/TypeScript/Assignment.hs index aa0c2c516..edd675136 100644 --- a/src/Language/TypeScript/Assignment.hs +++ b/src/Language/TypeScript/Assignment.hs @@ -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) diff --git a/src/Language/TypeScript/Syntax.hs b/src/Language/TypeScript/Syntax.hs index 47df29b68..f44fbfe77 100644 --- a/src/Language/TypeScript/Syntax.hs +++ b/src/Language/TypeScript/Syntax.hs @@ -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