mirror of
https://github.com/github/semantic.git
synced 2024-11-28 01:47:01 +03:00
Assign splices and quasi quotes
This commit is contained in:
parent
0e8532a8e1
commit
73cd692f80
@ -85,10 +85,16 @@ type Syntax = '[
|
||||
, Syntax.QualifiedEntityIdentifier
|
||||
, Syntax.QualifiedImportDeclaration
|
||||
, Syntax.QuasiQuotation
|
||||
, Syntax.QuasiQuotationDeclaration
|
||||
, Syntax.QuasiQuotationExpression
|
||||
, Syntax.QuasiQuotationExpressionBody
|
||||
, Syntax.QuasiQuotationPattern
|
||||
, Syntax.QuasiQuotationQuoter
|
||||
, Syntax.QuasiQuotationType
|
||||
, Syntax.QuotedName
|
||||
, Syntax.RecordDataConstructor
|
||||
, Syntax.ScopedTypeVariables
|
||||
, Syntax.Splice
|
||||
, Syntax.StandaloneDerivingInstance
|
||||
, Syntax.Star
|
||||
, Syntax.StrictType
|
||||
@ -274,9 +280,15 @@ expressionChoices = [
|
||||
, qualifiedTypeConstructorIdentifier
|
||||
, qualifiedVariableIdentifier
|
||||
, quasiQuotation
|
||||
, quasiQuotationDeclaration
|
||||
, quasiQuotationExpression
|
||||
, quasiQuotationExpressionBody
|
||||
, quasiQuotationPattern
|
||||
, quasiQuotationQuoter
|
||||
, quasiQuotationType
|
||||
, quotedName
|
||||
, scopedTypeVariables
|
||||
, splice
|
||||
, standaloneDerivingInstance
|
||||
, star
|
||||
, strictType
|
||||
@ -513,10 +525,25 @@ qualifiedVariableIdentifier :: Assignment
|
||||
qualifiedVariableIdentifier = makeTerm <$> symbol QualifiedVariableIdentifier <*> children (Syntax.QualifiedVariableIdentifier <$> someTerm' expression)
|
||||
|
||||
quasiQuotation :: Assignment
|
||||
quasiQuotation = makeTerm <$> symbol QuasiQuotation <*> children (Syntax.QuasiQuotation <$> expression <*> expression)
|
||||
quasiQuotation = makeTerm <$> symbol QuasiQuotation <*> children (Syntax.QuasiQuotation <$> (expression <|> emptyTerm) <*> expression)
|
||||
|
||||
quasiQuotationDeclaration :: Assignment
|
||||
quasiQuotationDeclaration = makeTerm <$> token QuasiQuotationDeclaration <*> pure Syntax.QuasiQuotationDeclaration
|
||||
|
||||
quasiQuotationExpression :: Assignment
|
||||
quasiQuotationExpression = makeTerm <$> symbol QuasiQuotationExpression <*> (Syntax.QuasiQuotationExpression . Name.name <$> source)
|
||||
quasiQuotationExpression = makeTerm <$> token QuasiQuotationExpression <*> pure Syntax.QuasiQuotationExpression
|
||||
|
||||
quasiQuotationExpressionBody :: Assignment
|
||||
quasiQuotationExpressionBody = makeTerm <$> symbol QuasiQuotationExpressionBody <*> (Syntax.QuasiQuotationExpressionBody . Name.name <$> source)
|
||||
|
||||
quasiQuotationPattern :: Assignment
|
||||
quasiQuotationPattern = makeTerm <$> token QuasiQuotationPattern <*> pure Syntax.QuasiQuotationPattern
|
||||
|
||||
quasiQuotationQuoter :: Assignment
|
||||
quasiQuotationQuoter = makeTerm <$> symbol QuasiQuotationQuoter <*> (Syntax.QuasiQuotationQuoter . Name.name <$> source)
|
||||
|
||||
quasiQuotationType :: Assignment
|
||||
quasiQuotationType = makeTerm <$> token QuasiQuotationType <*> pure Syntax.QuasiQuotationType
|
||||
|
||||
quotedName :: Assignment
|
||||
quotedName = makeTerm <$> symbol QuotedName <*> children (Syntax.QuotedName <$> expression)
|
||||
@ -524,6 +551,9 @@ quotedName = makeTerm <$> symbol QuotedName <*> children (Syntax.QuotedName <$>
|
||||
scopedTypeVariables :: Assignment
|
||||
scopedTypeVariables = makeTerm <$> symbol ScopedTypeVariables <*> children (Syntax.ScopedTypeVariables <$> expressions <* token Dot)
|
||||
|
||||
splice :: Assignment
|
||||
splice = makeTerm <$> symbol Splice <*> children (Syntax.Splice <$> expression)
|
||||
|
||||
standaloneDerivingInstance :: Assignment
|
||||
standaloneDerivingInstance = makeTerm <$> symbol StandaloneDerivingDeclaration <*> children (Syntax.StandaloneDerivingInstance <$> manyTerm (context' <|> scopedTypeVariables) <*> expression <*> instance')
|
||||
where
|
||||
|
@ -580,7 +580,52 @@ instance Show1 QuasiQuotation where liftShowsPrec = genericLiftShowsPrec
|
||||
|
||||
instance Evaluatable QuasiQuotation
|
||||
|
||||
newtype QuasiQuotationExpression a = QuasiQuotationExpression Name
|
||||
newtype QuasiQuotationExpressionBody a = QuasiQuotationExpressionBody Name
|
||||
deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable)
|
||||
|
||||
instance Eq1 QuasiQuotationExpressionBody where liftEq = genericLiftEq
|
||||
instance Ord1 QuasiQuotationExpressionBody where liftCompare = genericLiftCompare
|
||||
instance Show1 QuasiQuotationExpressionBody where liftShowsPrec = genericLiftShowsPrec
|
||||
|
||||
instance Evaluatable QuasiQuotationExpressionBody
|
||||
|
||||
data QuasiQuotationPattern a = QuasiQuotationPattern
|
||||
deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable)
|
||||
|
||||
instance Eq1 QuasiQuotationPattern where liftEq = genericLiftEq
|
||||
instance Ord1 QuasiQuotationPattern where liftCompare = genericLiftCompare
|
||||
instance Show1 QuasiQuotationPattern where liftShowsPrec = genericLiftShowsPrec
|
||||
|
||||
instance Evaluatable QuasiQuotationPattern
|
||||
|
||||
data QuasiQuotationType a = QuasiQuotationType
|
||||
deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable)
|
||||
|
||||
instance Eq1 QuasiQuotationType where liftEq = genericLiftEq
|
||||
instance Ord1 QuasiQuotationType where liftCompare = genericLiftCompare
|
||||
instance Show1 QuasiQuotationType where liftShowsPrec = genericLiftShowsPrec
|
||||
|
||||
instance Evaluatable QuasiQuotationType
|
||||
|
||||
data QuasiQuotationDeclaration a = QuasiQuotationDeclaration
|
||||
deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable)
|
||||
|
||||
instance Eq1 QuasiQuotationDeclaration where liftEq = genericLiftEq
|
||||
instance Ord1 QuasiQuotationDeclaration where liftCompare = genericLiftCompare
|
||||
instance Show1 QuasiQuotationDeclaration where liftShowsPrec = genericLiftShowsPrec
|
||||
|
||||
instance Evaluatable QuasiQuotationDeclaration
|
||||
|
||||
newtype QuasiQuotationQuoter a = QuasiQuotationQuoter Name
|
||||
deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable)
|
||||
|
||||
instance Eq1 QuasiQuotationQuoter where liftEq = genericLiftEq
|
||||
instance Ord1 QuasiQuotationQuoter where liftCompare = genericLiftCompare
|
||||
instance Show1 QuasiQuotationQuoter where liftShowsPrec = genericLiftShowsPrec
|
||||
|
||||
instance Evaluatable QuasiQuotationQuoter
|
||||
|
||||
data QuasiQuotationExpression a = QuasiQuotationExpression
|
||||
deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable)
|
||||
|
||||
instance Eq1 QuasiQuotationExpression where liftEq = genericLiftEq
|
||||
@ -588,3 +633,12 @@ instance Ord1 QuasiQuotationExpression where liftCompare = genericLiftCompare
|
||||
instance Show1 QuasiQuotationExpression where liftShowsPrec = genericLiftShowsPrec
|
||||
|
||||
instance Evaluatable QuasiQuotationExpression
|
||||
|
||||
newtype Splice a = Splice a
|
||||
deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable)
|
||||
|
||||
instance Eq1 Splice where liftEq = genericLiftEq
|
||||
instance Ord1 Splice where liftCompare = genericLiftCompare
|
||||
instance Show1 Splice where liftShowsPrec = genericLiftShowsPrec
|
||||
|
||||
instance Evaluatable Splice
|
||||
|
@ -55,12 +55,17 @@
|
||||
(TypeVariableIdentifier))
|
||||
(TypeVariableIdentifier)))
|
||||
(Empty))
|
||||
{+(Datatype
|
||||
{+(Empty)+}
|
||||
{+(Type
|
||||
{+(TypeConstructorIdentifier)+}
|
||||
{+(TypeParameters)+}
|
||||
{+(Empty)+})+}
|
||||
(Datatype
|
||||
(Empty)
|
||||
(Type
|
||||
{ (TypeConstructorIdentifier)
|
||||
->(TypeConstructorIdentifier) }
|
||||
(TypeParameters)
|
||||
(Empty))
|
||||
(Constructor
|
||||
{ (ConstructorIdentifier)
|
||||
->(ConstructorIdentifier) }
|
||||
(TypeParameters))
|
||||
{+(Constructor
|
||||
{+(ConstructorIdentifier)+}
|
||||
{+(TypeParameters)+})+}
|
||||
@ -76,106 +81,6 @@
|
||||
{+(Constructor
|
||||
{+(ConstructorIdentifier)+}
|
||||
{+(TypeParameters)+})+}
|
||||
{+(Constructor
|
||||
{+(ConstructorIdentifier)+}
|
||||
{+(TypeParameters)+})+}
|
||||
{+(Empty)+})+}
|
||||
{+(Datatype
|
||||
{+(Empty)+}
|
||||
{+(Type
|
||||
{+(TypeConstructorIdentifier)+}
|
||||
{+(TypeParameters)+}
|
||||
{+(Empty)+})+}
|
||||
{+(RecordDataConstructor
|
||||
{+(ConstructorIdentifier)+}
|
||||
{+(Statements
|
||||
{+(Field
|
||||
{+(Statements
|
||||
{+(VariableIdentifier)+})+}
|
||||
{+(Type
|
||||
{+(TypeConstructorIdentifier)+}
|
||||
{+(TypeParameters)+}
|
||||
{+(Empty)+})+})+})+})+}
|
||||
{+(Empty)+})+}
|
||||
{+(Datatype
|
||||
{+(Empty)+}
|
||||
{+(Type
|
||||
{+(TypeConstructorIdentifier)+}
|
||||
{+(TypeParameters)+}
|
||||
{+(Empty)+})+}
|
||||
{+(RecordDataConstructor
|
||||
{+(ConstructorIdentifier)+}
|
||||
{+(Statements
|
||||
{+(Field
|
||||
{+(Statements
|
||||
{+(VariableIdentifier)+}
|
||||
{+(VariableIdentifier)+})+}
|
||||
{+(Type
|
||||
{+(TypeConstructorIdentifier)+}
|
||||
{+(TypeParameters)+}
|
||||
{+(Empty)+})+})+})+})+}
|
||||
{+(Empty)+})+}
|
||||
{+(Datatype
|
||||
{+(Empty)+}
|
||||
{+(Type
|
||||
{+(TypeConstructorIdentifier)+}
|
||||
{+(TypeParameters)+}
|
||||
{+(Empty)+})+}
|
||||
{+(RecordDataConstructor
|
||||
{+(ConstructorIdentifier)+}
|
||||
{+(Statements
|
||||
{+(Field
|
||||
{+(Statements
|
||||
{+(VariableIdentifier)+})+}
|
||||
{+(Type
|
||||
{+(StrictType
|
||||
{+(TypeConstructorIdentifier)+}
|
||||
{+(TypeParameters)+})+}
|
||||
{+(TypeParameters)+}
|
||||
{+(Empty)+})+})+}
|
||||
{+(Field
|
||||
{+(Statements
|
||||
{+(VariableIdentifier)+})+}
|
||||
{+(Type
|
||||
{+(TypeConstructorIdentifier)+}
|
||||
{+(TypeParameters)+}
|
||||
{+(Empty)+})+})+})+})+}
|
||||
{+(Empty)+})+}
|
||||
{+(Datatype
|
||||
{+(Empty)+}
|
||||
{+(Type
|
||||
{+(TypeConstructorIdentifier)+}
|
||||
{+(TypeParameters)+}
|
||||
{+(Empty)+})+}
|
||||
{+(RecordDataConstructor
|
||||
{+(ConstructorIdentifier)+}
|
||||
{+(Statements
|
||||
{+(Field
|
||||
{+(Statements
|
||||
{+(VariableIdentifier)+}
|
||||
{+(VariableIdentifier)+})+}
|
||||
{+(Type
|
||||
{+(Context
|
||||
{+(Pragma)+}
|
||||
{+(StrictType
|
||||
{+(TypeConstructorIdentifier)+}
|
||||
{+(TypeParameters)+})+})+}
|
||||
{+(TypeParameters)+}
|
||||
{+(Empty)+})+})+}
|
||||
{+(Field
|
||||
{+(Statements
|
||||
{+(VariableIdentifier)+})+}
|
||||
{+(Type
|
||||
{+(TypeConstructorIdentifier)+}
|
||||
{+(TypeParameters)+}
|
||||
{+(Empty)+})+})+})+})+}
|
||||
{+(Empty)+})+}
|
||||
{-(Datatype
|
||||
{-(Empty)-}
|
||||
{-(Type
|
||||
{-(TypeConstructorIdentifier)-}
|
||||
{-(TypeParameters)-}
|
||||
{-(Empty)-})-}
|
||||
{-(Constructor
|
||||
{-(ConstructorIdentifier)-}
|
||||
{-(TypeParameters)-})-}
|
||||
@ -191,100 +96,105 @@
|
||||
{-(Constructor
|
||||
{-(ConstructorIdentifier)-}
|
||||
{-(TypeParameters)-})-}
|
||||
{-(Constructor
|
||||
{-(ConstructorIdentifier)-}
|
||||
{-(TypeParameters)-})-}
|
||||
{-(Empty)-})-}
|
||||
{-(Datatype
|
||||
{-(Empty)-}
|
||||
{-(Type
|
||||
{-(TypeConstructorIdentifier)-}
|
||||
{-(TypeParameters)-}
|
||||
{-(Empty)-})-}
|
||||
{-(RecordDataConstructor
|
||||
{-(ConstructorIdentifier)-}
|
||||
{-(Statements
|
||||
{-(Field
|
||||
{-(Statements
|
||||
{-(VariableIdentifier)-})-}
|
||||
{-(Type
|
||||
{-(TypeConstructorIdentifier)-}
|
||||
{-(TypeParameters)-}
|
||||
{-(Empty)-})-})-})-})-}
|
||||
{-(Empty)-})-}
|
||||
{-(Datatype
|
||||
{-(Empty)-}
|
||||
{-(Type
|
||||
{-(TypeConstructorIdentifier)-}
|
||||
{-(TypeParameters)-}
|
||||
{-(Empty)-})-}
|
||||
{-(RecordDataConstructor
|
||||
{-(ConstructorIdentifier)-}
|
||||
{-(Statements
|
||||
{-(Field
|
||||
{-(Statements
|
||||
{-(VariableIdentifier)-}
|
||||
{-(VariableIdentifier)-})-}
|
||||
{-(Type
|
||||
{-(TypeConstructorIdentifier)-}
|
||||
{-(TypeParameters)-}
|
||||
{-(Empty)-})-})-})-})-}
|
||||
{-(Empty)-})-}
|
||||
{-(Datatype
|
||||
{-(Empty)-}
|
||||
{-(Type
|
||||
{-(TypeConstructorIdentifier)-}
|
||||
{-(TypeParameters)-}
|
||||
{-(Empty)-})-}
|
||||
{-(RecordDataConstructor
|
||||
{-(ConstructorIdentifier)-}
|
||||
{-(Statements
|
||||
{-(Field
|
||||
{-(Statements
|
||||
{-(VariableIdentifier)-})-}
|
||||
{-(Type
|
||||
{-(StrictType
|
||||
{-(TypeConstructorIdentifier)-}
|
||||
{-(TypeParameters)-})-}
|
||||
{-(TypeParameters)-}
|
||||
{-(Empty)-})-})-}
|
||||
{-(Field
|
||||
{-(Statements
|
||||
{-(VariableIdentifier)-})-}
|
||||
{-(Type
|
||||
{-(TypeConstructorIdentifier)-}
|
||||
{-(TypeParameters)-}
|
||||
{-(Empty)-})-})-})-})-}
|
||||
{-(Empty)-})-}
|
||||
{-(Datatype
|
||||
{-(Empty)-}
|
||||
{-(Type
|
||||
{-(TypeConstructorIdentifier)-}
|
||||
{-(TypeParameters)-}
|
||||
{-(Empty)-})-}
|
||||
{-(RecordDataConstructor
|
||||
{-(ConstructorIdentifier)-}
|
||||
{-(Statements
|
||||
{-(Field
|
||||
{-(Statements
|
||||
{-(VariableIdentifier)-}
|
||||
{-(VariableIdentifier)-})-}
|
||||
{-(Type
|
||||
{-(Context
|
||||
{-(Pragma)-}
|
||||
{-(StrictType
|
||||
{-(TypeConstructorIdentifier)-}
|
||||
{-(TypeParameters)-})-})-}
|
||||
{-(TypeParameters)-}
|
||||
{-(Empty)-})-})-}
|
||||
{-(Field
|
||||
{-(Statements
|
||||
{-(VariableIdentifier)-})-}
|
||||
{-(Type
|
||||
{-(TypeConstructorIdentifier)-}
|
||||
{-(TypeParameters)-}
|
||||
{-(Empty)-})-})-})-})-}
|
||||
{-(Empty)-})-}
|
||||
(Empty))
|
||||
(Datatype
|
||||
(Empty)
|
||||
(Type
|
||||
{ (TypeConstructorIdentifier)
|
||||
->(TypeConstructorIdentifier) }
|
||||
(TypeParameters)
|
||||
(Empty))
|
||||
(RecordDataConstructor
|
||||
{ (ConstructorIdentifier)
|
||||
->(ConstructorIdentifier) }
|
||||
(Statements
|
||||
(Field
|
||||
(Statements
|
||||
(VariableIdentifier))
|
||||
(Type
|
||||
(TypeConstructorIdentifier)
|
||||
(TypeParameters)
|
||||
(Empty)))))
|
||||
(Empty))
|
||||
(Datatype
|
||||
(Empty)
|
||||
(Type
|
||||
{ (TypeConstructorIdentifier)
|
||||
->(TypeConstructorIdentifier) }
|
||||
(TypeParameters)
|
||||
(Empty))
|
||||
(RecordDataConstructor
|
||||
{ (ConstructorIdentifier)
|
||||
->(ConstructorIdentifier) }
|
||||
(Statements
|
||||
(Field
|
||||
(Statements
|
||||
(VariableIdentifier)
|
||||
(VariableIdentifier))
|
||||
(Type
|
||||
(TypeConstructorIdentifier)
|
||||
(TypeParameters)
|
||||
(Empty)))))
|
||||
(Empty))
|
||||
(Datatype
|
||||
(Empty)
|
||||
(Type
|
||||
{ (TypeConstructorIdentifier)
|
||||
->(TypeConstructorIdentifier) }
|
||||
(TypeParameters)
|
||||
(Empty))
|
||||
(RecordDataConstructor
|
||||
{ (ConstructorIdentifier)
|
||||
->(ConstructorIdentifier) }
|
||||
(Statements
|
||||
(Field
|
||||
(Statements
|
||||
(VariableIdentifier))
|
||||
(Type
|
||||
(StrictType
|
||||
(TypeConstructorIdentifier)
|
||||
(TypeParameters))
|
||||
(TypeParameters)
|
||||
(Empty)))
|
||||
(Field
|
||||
(Statements
|
||||
(VariableIdentifier))
|
||||
(Type
|
||||
(TypeConstructorIdentifier)
|
||||
(TypeParameters)
|
||||
(Empty)))))
|
||||
(Empty))
|
||||
(Datatype
|
||||
(Empty)
|
||||
(Type
|
||||
{ (TypeConstructorIdentifier)
|
||||
->(TypeConstructorIdentifier) }
|
||||
(TypeParameters)
|
||||
(Empty))
|
||||
(RecordDataConstructor
|
||||
{ (ConstructorIdentifier)
|
||||
->(ConstructorIdentifier) }
|
||||
(Statements
|
||||
(Field
|
||||
(Statements
|
||||
(VariableIdentifier)
|
||||
(VariableIdentifier))
|
||||
(Type
|
||||
(Context
|
||||
(Pragma)
|
||||
(StrictType
|
||||
(TypeConstructorIdentifier)
|
||||
(TypeParameters)))
|
||||
(TypeParameters)
|
||||
(Empty)))
|
||||
(Field
|
||||
(Statements
|
||||
(VariableIdentifier))
|
||||
(Type
|
||||
(TypeConstructorIdentifier)
|
||||
(TypeParameters)
|
||||
(Empty)))))
|
||||
(Empty))
|
||||
{-(Datatype
|
||||
{-(Empty)-}
|
||||
{-(Type
|
||||
|
@ -55,66 +55,6 @@
|
||||
(TypeVariableIdentifier))
|
||||
(TypeVariableIdentifier)))
|
||||
(Empty))
|
||||
{+(Datatype
|
||||
{+(Empty)+}
|
||||
{+(Type
|
||||
{+(TypeConstructorIdentifier)+}
|
||||
{+(TypeParameters)+}
|
||||
{+(Empty)+})+}
|
||||
{+(Constructor
|
||||
{+(ConstructorIdentifier)+}
|
||||
{+(TypeParameters)+})+}
|
||||
{+(Constructor
|
||||
{+(ConstructorIdentifier)+}
|
||||
{+(TypeParameters)+})+}
|
||||
{+(Constructor
|
||||
{+(ConstructorIdentifier)+}
|
||||
{+(TypeParameters)+})+}
|
||||
{+(Constructor
|
||||
{+(ConstructorIdentifier)+}
|
||||
{+(TypeParameters)+})+}
|
||||
{+(Constructor
|
||||
{+(ConstructorIdentifier)+}
|
||||
{+(TypeParameters)+})+}
|
||||
{+(Constructor
|
||||
{+(ConstructorIdentifier)+}
|
||||
{+(TypeParameters)+})+}
|
||||
{+(Empty)+})+}
|
||||
{+(Datatype
|
||||
{+(Empty)+}
|
||||
{+(Type
|
||||
{+(TypeConstructorIdentifier)+}
|
||||
{+(TypeParameters)+}
|
||||
{+(Empty)+})+}
|
||||
{+(RecordDataConstructor
|
||||
{+(ConstructorIdentifier)+}
|
||||
{+(Statements
|
||||
{+(Field
|
||||
{+(Statements
|
||||
{+(VariableIdentifier)+})+}
|
||||
{+(Type
|
||||
{+(TypeConstructorIdentifier)+}
|
||||
{+(TypeParameters)+}
|
||||
{+(Empty)+})+})+})+})+}
|
||||
{+(Empty)+})+}
|
||||
{+(Datatype
|
||||
{+(Empty)+}
|
||||
{+(Type
|
||||
{+(TypeConstructorIdentifier)+}
|
||||
{+(TypeParameters)+}
|
||||
{+(Empty)+})+}
|
||||
{+(RecordDataConstructor
|
||||
{+(ConstructorIdentifier)+}
|
||||
{+(Statements
|
||||
{+(Field
|
||||
{+(Statements
|
||||
{+(VariableIdentifier)+}
|
||||
{+(VariableIdentifier)+})+}
|
||||
{+(Type
|
||||
{+(TypeConstructorIdentifier)+}
|
||||
{+(TypeParameters)+}
|
||||
{+(Empty)+})+})+})+})+}
|
||||
{+(Empty)+})+}
|
||||
(Datatype
|
||||
(Empty)
|
||||
(Type
|
||||
@ -122,28 +62,25 @@
|
||||
->(TypeConstructorIdentifier) }
|
||||
(TypeParameters)
|
||||
(Empty))
|
||||
{+(RecordDataConstructor
|
||||
(Constructor
|
||||
{ (ConstructorIdentifier)
|
||||
->(ConstructorIdentifier) }
|
||||
(TypeParameters))
|
||||
{+(Constructor
|
||||
{+(ConstructorIdentifier)+}
|
||||
{+(TypeParameters)+})+}
|
||||
{+(Constructor
|
||||
{+(ConstructorIdentifier)+}
|
||||
{+(TypeParameters)+})+}
|
||||
{+(Constructor
|
||||
{+(ConstructorIdentifier)+}
|
||||
{+(TypeParameters)+})+}
|
||||
{+(Constructor
|
||||
{+(ConstructorIdentifier)+}
|
||||
{+(TypeParameters)+})+}
|
||||
{+(Constructor
|
||||
{+(ConstructorIdentifier)+}
|
||||
{+(Statements
|
||||
{+(Field
|
||||
{+(Statements
|
||||
{+(VariableIdentifier)+})+}
|
||||
{+(Type
|
||||
{+(StrictType
|
||||
{+(TypeConstructorIdentifier)+}
|
||||
{+(TypeParameters)+})+}
|
||||
{+(TypeParameters)+}
|
||||
{+(Empty)+})+})+}
|
||||
{+(Field
|
||||
{+(Statements
|
||||
{+(VariableIdentifier)+})+}
|
||||
{+(Type
|
||||
{+(TypeConstructorIdentifier)+}
|
||||
{+(TypeParameters)+}
|
||||
{+(Empty)+})+})+})+})+}
|
||||
{-(Constructor
|
||||
{-(ConstructorIdentifier)-}
|
||||
{-(TypeParameters)-})-}
|
||||
{-(Constructor
|
||||
{-(ConstructorIdentifier)-}
|
||||
{-(TypeParameters)-})-}
|
||||
@ -160,35 +97,104 @@
|
||||
{-(ConstructorIdentifier)-}
|
||||
{-(TypeParameters)-})-}
|
||||
(Empty))
|
||||
{+(Datatype
|
||||
{+(Empty)+}
|
||||
{+(Type
|
||||
{+(TypeConstructorIdentifier)+}
|
||||
{+(TypeParameters)+}
|
||||
{+(Empty)+})+}
|
||||
{+(RecordDataConstructor
|
||||
{+(ConstructorIdentifier)+}
|
||||
{+(Statements
|
||||
{+(Field
|
||||
{+(Statements
|
||||
{+(VariableIdentifier)+}
|
||||
{+(VariableIdentifier)+})+}
|
||||
{+(Type
|
||||
{+(Context
|
||||
{+(Pragma)+}
|
||||
{+(StrictType
|
||||
{+(TypeConstructorIdentifier)+}
|
||||
{+(TypeParameters)+})+})+}
|
||||
{+(TypeParameters)+}
|
||||
{+(Empty)+})+})+}
|
||||
{+(Field
|
||||
{+(Statements
|
||||
{+(VariableIdentifier)+})+}
|
||||
{+(Type
|
||||
{+(TypeConstructorIdentifier)+}
|
||||
{+(TypeParameters)+}
|
||||
{+(Empty)+})+})+})+})+}
|
||||
{+(Empty)+})+}
|
||||
(Datatype
|
||||
(Empty)
|
||||
(Type
|
||||
{ (TypeConstructorIdentifier)
|
||||
->(TypeConstructorIdentifier) }
|
||||
(TypeParameters)
|
||||
(Empty))
|
||||
(RecordDataConstructor
|
||||
{ (ConstructorIdentifier)
|
||||
->(ConstructorIdentifier) }
|
||||
(Statements
|
||||
(Field
|
||||
(Statements
|
||||
(VariableIdentifier))
|
||||
(Type
|
||||
(TypeConstructorIdentifier)
|
||||
(TypeParameters)
|
||||
(Empty)))))
|
||||
(Empty))
|
||||
(Datatype
|
||||
(Empty)
|
||||
(Type
|
||||
{ (TypeConstructorIdentifier)
|
||||
->(TypeConstructorIdentifier) }
|
||||
(TypeParameters)
|
||||
(Empty))
|
||||
(RecordDataConstructor
|
||||
{ (ConstructorIdentifier)
|
||||
->(ConstructorIdentifier) }
|
||||
(Statements
|
||||
(Field
|
||||
(Statements
|
||||
(VariableIdentifier)
|
||||
(VariableIdentifier))
|
||||
(Type
|
||||
(TypeConstructorIdentifier)
|
||||
(TypeParameters)
|
||||
(Empty)))))
|
||||
(Empty))
|
||||
(Datatype
|
||||
(Empty)
|
||||
(Type
|
||||
{ (TypeConstructorIdentifier)
|
||||
->(TypeConstructorIdentifier) }
|
||||
(TypeParameters)
|
||||
(Empty))
|
||||
(RecordDataConstructor
|
||||
{ (ConstructorIdentifier)
|
||||
->(ConstructorIdentifier) }
|
||||
(Statements
|
||||
(Field
|
||||
(Statements
|
||||
(VariableIdentifier))
|
||||
(Type
|
||||
(StrictType
|
||||
(TypeConstructorIdentifier)
|
||||
(TypeParameters))
|
||||
(TypeParameters)
|
||||
(Empty)))
|
||||
(Field
|
||||
(Statements
|
||||
(VariableIdentifier))
|
||||
(Type
|
||||
(TypeConstructorIdentifier)
|
||||
(TypeParameters)
|
||||
(Empty)))))
|
||||
(Empty))
|
||||
(Datatype
|
||||
(Empty)
|
||||
(Type
|
||||
{ (TypeConstructorIdentifier)
|
||||
->(TypeConstructorIdentifier) }
|
||||
(TypeParameters)
|
||||
(Empty))
|
||||
(RecordDataConstructor
|
||||
{ (ConstructorIdentifier)
|
||||
->(ConstructorIdentifier) }
|
||||
(Statements
|
||||
(Field
|
||||
(Statements
|
||||
(VariableIdentifier)
|
||||
(VariableIdentifier))
|
||||
(Type
|
||||
(Context
|
||||
(Pragma)
|
||||
(StrictType
|
||||
(TypeConstructorIdentifier)
|
||||
(TypeParameters)))
|
||||
(TypeParameters)
|
||||
(Empty)))
|
||||
(Field
|
||||
(Statements
|
||||
(VariableIdentifier))
|
||||
(Type
|
||||
(TypeConstructorIdentifier)
|
||||
(TypeParameters)
|
||||
(Empty)))))
|
||||
(Empty))
|
||||
{+(Datatype
|
||||
{+(Empty)+}
|
||||
{+(Type
|
||||
@ -216,96 +222,6 @@
|
||||
{+(TypeParameters)+}
|
||||
{+(Empty)+})+})+})+})+}
|
||||
{+(Empty)+})+}
|
||||
{-(Datatype
|
||||
{-(Empty)-}
|
||||
{-(Type
|
||||
{-(TypeConstructorIdentifier)-}
|
||||
{-(TypeParameters)-}
|
||||
{-(Empty)-})-}
|
||||
{-(RecordDataConstructor
|
||||
{-(ConstructorIdentifier)-}
|
||||
{-(Statements
|
||||
{-(Field
|
||||
{-(Statements
|
||||
{-(VariableIdentifier)-})-}
|
||||
{-(Type
|
||||
{-(TypeConstructorIdentifier)-}
|
||||
{-(TypeParameters)-}
|
||||
{-(Empty)-})-})-})-})-}
|
||||
{-(Empty)-})-}
|
||||
{-(Datatype
|
||||
{-(Empty)-}
|
||||
{-(Type
|
||||
{-(TypeConstructorIdentifier)-}
|
||||
{-(TypeParameters)-}
|
||||
{-(Empty)-})-}
|
||||
{-(RecordDataConstructor
|
||||
{-(ConstructorIdentifier)-}
|
||||
{-(Statements
|
||||
{-(Field
|
||||
{-(Statements
|
||||
{-(VariableIdentifier)-}
|
||||
{-(VariableIdentifier)-})-}
|
||||
{-(Type
|
||||
{-(TypeConstructorIdentifier)-}
|
||||
{-(TypeParameters)-}
|
||||
{-(Empty)-})-})-})-})-}
|
||||
{-(Empty)-})-}
|
||||
{-(Datatype
|
||||
{-(Empty)-}
|
||||
{-(Type
|
||||
{-(TypeConstructorIdentifier)-}
|
||||
{-(TypeParameters)-}
|
||||
{-(Empty)-})-}
|
||||
{-(RecordDataConstructor
|
||||
{-(ConstructorIdentifier)-}
|
||||
{-(Statements
|
||||
{-(Field
|
||||
{-(Statements
|
||||
{-(VariableIdentifier)-})-}
|
||||
{-(Type
|
||||
{-(StrictType
|
||||
{-(TypeConstructorIdentifier)-}
|
||||
{-(TypeParameters)-})-}
|
||||
{-(TypeParameters)-}
|
||||
{-(Empty)-})-})-}
|
||||
{-(Field
|
||||
{-(Statements
|
||||
{-(VariableIdentifier)-})-}
|
||||
{-(Type
|
||||
{-(TypeConstructorIdentifier)-}
|
||||
{-(TypeParameters)-}
|
||||
{-(Empty)-})-})-})-})-}
|
||||
{-(Empty)-})-}
|
||||
{-(Datatype
|
||||
{-(Empty)-}
|
||||
{-(Type
|
||||
{-(TypeConstructorIdentifier)-}
|
||||
{-(TypeParameters)-}
|
||||
{-(Empty)-})-}
|
||||
{-(RecordDataConstructor
|
||||
{-(ConstructorIdentifier)-}
|
||||
{-(Statements
|
||||
{-(Field
|
||||
{-(Statements
|
||||
{-(VariableIdentifier)-}
|
||||
{-(VariableIdentifier)-})-}
|
||||
{-(Type
|
||||
{-(Context
|
||||
{-(Pragma)-}
|
||||
{-(StrictType
|
||||
{-(TypeConstructorIdentifier)-}
|
||||
{-(TypeParameters)-})-})-}
|
||||
{-(TypeParameters)-}
|
||||
{-(Empty)-})-})-}
|
||||
{-(Field
|
||||
{-(Statements
|
||||
{-(VariableIdentifier)-})-}
|
||||
{-(Type
|
||||
{-(TypeConstructorIdentifier)-}
|
||||
{-(TypeParameters)-}
|
||||
{-(Empty)-})-})-})-})-}
|
||||
{-(Empty)-})-}
|
||||
(Datatype
|
||||
(Empty)
|
||||
(Type
|
||||
|
42
test/fixtures/haskell/corpus/tempate-haskell.A.hs
vendored
Normal file
42
test/fixtures/haskell/corpus/tempate-haskell.A.hs
vendored
Normal file
@ -0,0 +1,42 @@
|
||||
[|example|]
|
||||
[e|example|]
|
||||
[p|example|]
|
||||
[t|example|]
|
||||
[d|example|]
|
||||
[str|example|]
|
||||
|
||||
[ | example| ]
|
||||
[ e| example| ]
|
||||
[ p| example| ]
|
||||
[ t| example| ]
|
||||
[ d| example| ]
|
||||
[ str| example| ]
|
||||
|
||||
[ | example | ]
|
||||
[ e | example | ]
|
||||
[ p | example | ]
|
||||
[ t | example | ]
|
||||
[ d | example | ]
|
||||
[ str | example | ]
|
||||
[str|integer,double,varchar,boolean,date,money,enum
|
||||
|13,3.14159,testing!,false,1900-01-01,$3.99,foo
|
||||
|12,0.1,a string,true,1929-10-01,12,bar
|
||||
|]
|
||||
|
||||
[ | [{ "ret_setof_integers": 1 },
|
||||
{ "ret_setof_integers": 2 },
|
||||
{ "ret_setof_integers": 3 }] | ]
|
||||
|
||||
[|
|
||||
[
|
||||
{ "ret_setof_integers": 1 },
|
||||
{ "ret_setof_integers": 2 },
|
||||
{ "ret_setof_integers": 3 }
|
||||
]
|
||||
|]
|
||||
|
||||
f = [|a|] `b` c
|
||||
|
||||
f = $x
|
||||
f = $(a . b $ c)
|
||||
$(makeEff ''Embedded)
|
100
test/fixtures/haskell/corpus/tempate-haskell.parseA.txt
vendored
Normal file
100
test/fixtures/haskell/corpus/tempate-haskell.parseA.txt
vendored
Normal file
@ -0,0 +1,100 @@
|
||||
(Module
|
||||
(Empty)
|
||||
(Statements
|
||||
(QuasiQuotation
|
||||
(Empty)
|
||||
(QuasiQuotationExpressionBody))
|
||||
(QuasiQuotation
|
||||
(QuasiQuotationExpression)
|
||||
(QuasiQuotationExpressionBody))
|
||||
(QuasiQuotation
|
||||
(QuasiQuotationPattern)
|
||||
(QuasiQuotationExpressionBody))
|
||||
(QuasiQuotation
|
||||
(QuasiQuotationType)
|
||||
(QuasiQuotationExpressionBody))
|
||||
(QuasiQuotation
|
||||
(QuasiQuotationDeclaration)
|
||||
(QuasiQuotationExpressionBody))
|
||||
(QuasiQuotation
|
||||
(QuasiQuotationQuoter)
|
||||
(QuasiQuotationExpressionBody))
|
||||
(QuasiQuotation
|
||||
(Empty)
|
||||
(QuasiQuotationExpressionBody))
|
||||
(QuasiQuotation
|
||||
(QuasiQuotationExpression)
|
||||
(QuasiQuotationExpressionBody))
|
||||
(QuasiQuotation
|
||||
(QuasiQuotationPattern)
|
||||
(QuasiQuotationExpressionBody))
|
||||
(QuasiQuotation
|
||||
(QuasiQuotationType)
|
||||
(QuasiQuotationExpressionBody))
|
||||
(QuasiQuotation
|
||||
(QuasiQuotationDeclaration)
|
||||
(QuasiQuotationExpressionBody))
|
||||
(QuasiQuotation
|
||||
(QuasiQuotationQuoter)
|
||||
(QuasiQuotationExpressionBody))
|
||||
(QuasiQuotation
|
||||
(Empty)
|
||||
(QuasiQuotationExpressionBody))
|
||||
(QuasiQuotation
|
||||
(QuasiQuotationExpression)
|
||||
(QuasiQuotationExpressionBody))
|
||||
(QuasiQuotation
|
||||
(QuasiQuotationPattern)
|
||||
(QuasiQuotationExpressionBody))
|
||||
(QuasiQuotation
|
||||
(QuasiQuotationType)
|
||||
(QuasiQuotationExpressionBody))
|
||||
(QuasiQuotation
|
||||
(QuasiQuotationDeclaration)
|
||||
(QuasiQuotationExpressionBody))
|
||||
(QuasiQuotation
|
||||
(QuasiQuotationQuoter)
|
||||
(QuasiQuotationExpressionBody))
|
||||
(QuasiQuotation
|
||||
(QuasiQuotationQuoter)
|
||||
(QuasiQuotationExpressionBody))
|
||||
(QuasiQuotation
|
||||
(Empty)
|
||||
(QuasiQuotationExpressionBody))
|
||||
(QuasiQuotation
|
||||
(Empty)
|
||||
(QuasiQuotationExpressionBody))
|
||||
(Function
|
||||
(VariableIdentifier)
|
||||
(Statements
|
||||
(InfixOperatorApp
|
||||
(QuasiQuotation
|
||||
(Empty)
|
||||
(QuasiQuotationExpressionBody))
|
||||
(VariableOperator
|
||||
(InfixVariableIdentifier))
|
||||
(VariableIdentifier))))
|
||||
(Function
|
||||
(VariableIdentifier)
|
||||
(Statements
|
||||
(Splice
|
||||
(VariableIdentifier))))
|
||||
(Function
|
||||
(VariableIdentifier)
|
||||
(Statements
|
||||
(Splice
|
||||
(InfixOperatorApp
|
||||
(VariableIdentifier)
|
||||
(VariableOperator
|
||||
(VariableSymbol))
|
||||
(InfixOperatorApp
|
||||
(VariableIdentifier)
|
||||
(VariableOperator
|
||||
(VariableSymbol))
|
||||
(VariableIdentifier))))))
|
||||
(Splice
|
||||
(App
|
||||
(VariableIdentifier)
|
||||
(QuotedName
|
||||
(QuotedName
|
||||
(TypeConstructorIdentifier)))))))
|
42
test/fixtures/haskell/corpus/template-haskell.B.hs
vendored
Normal file
42
test/fixtures/haskell/corpus/template-haskell.B.hs
vendored
Normal file
@ -0,0 +1,42 @@
|
||||
[|example'|]
|
||||
[e|example'|]
|
||||
[p|example'|]
|
||||
[t|example'|]
|
||||
[d|example'|]
|
||||
[str|example'|]
|
||||
|
||||
[ | example'| ]
|
||||
[ e| example'| ]
|
||||
[ p| example'| ]
|
||||
[ t| example'| ]
|
||||
[ d| example'| ]
|
||||
[ str| example'| ]
|
||||
|
||||
[ | example' | ]
|
||||
[ e | example' | ]
|
||||
[ p | example' | ]
|
||||
[ t | example' | ]
|
||||
[ d | example' | ]
|
||||
[ str | example' | ]
|
||||
[str|integer,double,varchar,boolean,date,money,enum
|
||||
|12,0.1,a string,true,1929-10-01,12,bar
|
||||
|13,3.14159,testing!,false,1900-01-01,$3.99,foo
|
||||
|]
|
||||
|
||||
[ | [{ "ret_setof_integers": 3 },
|
||||
{ "ret_setof_integers": 4 },
|
||||
{ "ret_setof_integers": 5 }] | ]
|
||||
|
||||
[|
|
||||
[
|
||||
{ "ret_setof_integers": 3 },
|
||||
{ "ret_setof_integers": 4 },
|
||||
{ "ret_setof_integers": 5 }
|
||||
]
|
||||
|]
|
||||
|
||||
g = [|a|] `b` c
|
||||
|
||||
g = $x
|
||||
g = $(a . b $ c)
|
||||
$(makeEff' ''Embedded)
|
@ -52,17 +52,17 @@
|
||||
(TypeConstructorIdentifier))
|
||||
(TypePattern
|
||||
(TupleConstructor)))
|
||||
(TypeSynonym
|
||||
(Statements
|
||||
(TypeConstructorIdentifier))
|
||||
(TypePattern
|
||||
{ (FunctionConstructor)
|
||||
->(TupleConstructor) }))
|
||||
{+(TypeSynonym
|
||||
{+(Statements
|
||||
{+(TypeConstructorIdentifier)+})+}
|
||||
{+(TypePattern
|
||||
{+(FunctionConstructor)+})+})+}
|
||||
{+(TupleConstructor)+})+})+}
|
||||
(TypeSynonym
|
||||
(Statements
|
||||
{ (TypeConstructorIdentifier)
|
||||
->(TypeConstructorIdentifier) })
|
||||
(TypePattern
|
||||
(FunctionConstructor)))
|
||||
(TypeSynonym
|
||||
(Statements
|
||||
(TypeConstructorIdentifier))
|
||||
|
@ -52,12 +52,11 @@
|
||||
(TypeConstructorIdentifier))
|
||||
(TypePattern
|
||||
(TupleConstructor)))
|
||||
(TypeSynonym
|
||||
(Statements
|
||||
(TypeConstructorIdentifier))
|
||||
(TypePattern
|
||||
{ (TupleConstructor)
|
||||
->(FunctionConstructor) }))
|
||||
{+(TypeSynonym
|
||||
{+(Statements
|
||||
{+(TypeConstructorIdentifier)+})+}
|
||||
{+(TypePattern
|
||||
{+(FunctionConstructor)+})+})+}
|
||||
{+(TypeSynonym
|
||||
{+(Statements
|
||||
{+(TypeConstructorIdentifier)+})+}
|
||||
@ -115,14 +114,11 @@
|
||||
{+(TypeConstructorIdentifier)+}
|
||||
{+(TypeVariableIdentifier)+})+})+}
|
||||
{+(Empty)+})+})+})+})+})+}
|
||||
(TypeSynonym
|
||||
(Statements
|
||||
{ (TypeConstructorIdentifier)
|
||||
->(TypeConstructorIdentifier) }
|
||||
{+(TypeConstructorIdentifier)+})
|
||||
{ (TypePattern
|
||||
{-(FunctionConstructor)-})
|
||||
->(TextElement) })
|
||||
{+(TypeSynonym
|
||||
{+(Statements
|
||||
{+(TypeConstructorIdentifier)+}
|
||||
{+(TypeConstructorIdentifier)+})+}
|
||||
{+(TextElement)+})+}
|
||||
{+(TypeSynonym
|
||||
{+(Statements
|
||||
{+(TypeConstructorIdentifier)+}
|
||||
@ -171,6 +167,16 @@
|
||||
{+(TypeConstructorIdentifier)+}
|
||||
{+(TypeVariableIdentifier)+}
|
||||
{+(TypeVariableIdentifier)+})+})+})+})+}
|
||||
{-(TypeSynonym
|
||||
{-(Statements
|
||||
{-(TypeConstructorIdentifier)-})-}
|
||||
{-(TypePattern
|
||||
{-(TupleConstructor)-})-})-}
|
||||
{-(TypeSynonym
|
||||
{-(Statements
|
||||
{-(TypeConstructorIdentifier)-})-}
|
||||
{-(TypePattern
|
||||
{-(FunctionConstructor)-})-})-}
|
||||
{-(TypeSynonym
|
||||
{-(Statements
|
||||
{-(TypeConstructorIdentifier)-})-}
|
||||
|
Loading…
Reference in New Issue
Block a user