1
1
mirror of https://github.com/github/semantic.git synced 2024-11-24 00:42:33 +03:00

Assign infix operator applications

This commit is contained in:
Rick Winfrey 2018-06-12 14:16:25 -07:00
parent bb48fe6d50
commit 7c38ddf4a2
2 changed files with 5 additions and 0 deletions

View File

@ -214,6 +214,7 @@ expressionChoices = [
, generator
, importAlias
, importDeclaration
, infixOperatorApp
, infixOperatorPattern
, infixVariableIdentifier
, integer
@ -342,6 +343,9 @@ importDeclaration = makeTerm
importSpec :: Assignment.Assignment [] Grammar [Term]
importSpec = symbol ImportSpec *> children (manyTerm import')
infixOperatorApp :: Assignment
infixOperatorApp = makeTerm <$> symbol InfixOperatorApplication <*> children (Syntax.InfixOperatorApp <$> expression <*> expression <*> expression)
infixOperatorPattern :: Assignment
infixOperatorPattern = makeTerm <$> symbol InfixOperatorPattern <*> children (Syntax.InfixOperatorPattern <$> expression <*> operator <*> expression)

View File

@ -448,6 +448,7 @@ instance Show1 ImportAlias where liftShowsPrec = genericLiftShowsPrec
instance Evaluatable ImportAlias
data App a = App { appLeft :: a, appRight :: a }
| InfixOperatorApp { appLeft :: a, infixOperator :: a, appRight :: a }
deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable)
instance Eq1 App where liftEq = genericLiftEq