From 8f9b505345a18df8409530efe36a2a778ffcd2b7 Mon Sep 17 00:00:00 2001 From: joshvera Date: Wed, 16 Aug 2017 20:48:11 -0400 Subject: [PATCH] Add TypeAssertion and Cast --- src/Language/TypeScript/Syntax.hs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/Language/TypeScript/Syntax.hs b/src/Language/TypeScript/Syntax.hs index 44c672b3f..f257e63c2 100644 --- a/src/Language/TypeScript/Syntax.hs +++ b/src/Language/TypeScript/Syntax.hs @@ -110,6 +110,8 @@ type Syntax = '[ , Language.TypeScript.Syntax.Function , Language.TypeScript.Syntax.Tuple , Language.TypeScript.Syntax.Constructor + , Language.TypeScript.Syntax.TypeAssertion + , Language.TypeScript.Syntax.Cast , Type.Visibility , [] ] @@ -160,6 +162,18 @@ data TypeParameter a = TypeParameter { typeParameter :: !a, typeParameterConstra instance Eq1 TypeParameter where liftEq = genericLiftEq instance Show1 TypeParameter where liftShowsPrec = genericLiftShowsPrec +data TypeAssertion a = TypeAssertion { typeAssertionParameters :: !a, typeAssertionExpression :: !a } + deriving (Diffable, Eq, Foldable, Functor, GAlign, Generic1, Show, Traversable) + +instance Eq1 TypeAssertion where liftEq = genericLiftEq +instance Show1 TypeAssertion where liftShowsPrec = genericLiftShowsPrec + +data Cast a = Cast { castSubject :: !a, castType :: !a } + deriving (Diffable, Eq, Foldable, Functor, GAlign, Generic1, Show, Traversable) + +instance Eq1 Cast where liftEq = genericLiftEq +instance Show1 Cast where liftShowsPrec = genericLiftShowsPrec + data Annotation a = Annotation { typeAnnotation :: !a } deriving (Diffable, Eq, Foldable, Functor, GAlign, Generic1, Show, Traversable)