1
1
mirror of https://github.com/github/semantic.git synced 2024-11-24 08:54:07 +03:00

Assign infix data constructors

This commit is contained in:
Rick Winfrey 2018-06-22 17:56:55 -07:00
parent 5dd83b0f2e
commit df279bd24a

View File

@ -78,6 +78,7 @@ type Syntax = '[
, Syntax.Import
, Syntax.ImportAlias
, Syntax.ImportDeclaration
, Syntax.InfixDataConstructor
, Syntax.InfixOperatorPattern
, Syntax.Instance
, Syntax.IrrefutablePattern
@ -211,6 +212,7 @@ conditionalExpression = makeTerm <$> symbol ConditionalExpression <*> children (
constructor :: Assignment
constructor = (makeTerm <$> symbol DataConstructor <*> children (Declaration.Constructor <$> manyTerm (context' <|> scopedTypeVariables) <*> typeConstructor <*> typeParameters))
<|> term (makeTerm <$> symbol RecordDataConstructor <*> children (Syntax.RecordDataConstructor <$> constructorIdentifier <*> (term fields)))
<|> term (makeTerm <$> symbol InfixDataConstructor <*> children (Syntax.InfixDataConstructor <$> expression <*> expression <*> expression))
constructorIdentifier :: Assignment
constructorIdentifier = makeTerm <$> symbol ConstructorIdentifier <*> (Syntax.ConstructorIdentifier . Name.name <$> source)