1
1
mirror of https://github.com/github/semantic.git synced 2024-12-24 23:42:31 +03:00

Assign primitive constructor identifiers

This commit is contained in:
Rick Winfrey 2018-06-08 10:13:24 -07:00
parent 0cc63f89f3
commit 867170b39a
7 changed files with 66 additions and 1 deletions

View File

@ -174,6 +174,7 @@ expressionChoices = [
, operator
, parenthesizedTypePattern
, pragma
, primitiveConstructorIdentifier
, qualifiedModuleIdentifier
, qualifiedTypeConstructorIdentifier
, quotedName
@ -316,6 +317,9 @@ parenthesizedTypePattern = symbol ParenthesizedTypePattern *> children expressio
pragma :: Assignment
pragma = makeTerm <$> symbol Pragma <*> (Syntax.Pragma <$> source)
primitiveConstructorIdentifier :: Assignment
primitiveConstructorIdentifier = makeTerm <$> symbol PrimitiveConstructorIdentifier <*> (Syntax.Identifier . Name.name <$> source)
qualifiedModuleIdentifier :: Assignment
qualifiedModuleIdentifier = makeTerm <$> symbol QualifiedModuleIdentifier <*> children (Syntax.QualifiedModuleIdentifier <$> someTerm' expression)
@ -335,7 +339,7 @@ strictType :: Assignment
strictType = makeTerm'
<$> symbol StrictType
<*> children ( (inject <$> (Syntax.StrictType <$> typeConstructor <*> typeParameters))
<|> (inject <$> (Syntax.StrictTypeVariable <$> typeVariableIdentifier)))
<|> (inject <$> (Syntax.StrictTypeVariable <$> expression)))
string :: Assignment
string = makeTerm <$> symbol String <*> (Literal.TextElement <$> source)

View File

@ -26,3 +26,5 @@ data (Eq (f a), Functor f) => N f a = N f a
data Foo bar = HasCallStack => Foo bar
data Baz foo = Show foo => Baz foo
data Foo = Foo !Double#

View File

@ -26,3 +26,6 @@ data (Eq (f a), Applicative f) => N f a = N f a
data Foo bar = HasCallStack => Wiz bar
data Baz a = Show a => Baz a
data Bar = Bar !Double#

View File

@ -423,4 +423,19 @@
(TypeParameters
{ (Identifier)
->(Identifier) }))
(Empty))
(Datatype
(Empty)
(Type
{ (Identifier)
->(Identifier) }
(TypeParameters)
(Empty))
(Constructor
(Empty)
{ (Identifier)
->(Identifier) }
(TypeParameters
(StrictTypeVariable
(Identifier))))
(Empty))))

View File

@ -420,4 +420,19 @@
(TypeParameters
{ (Identifier)
->(Identifier) }))
(Empty))
(Datatype
(Empty)
(Type
{ (Identifier)
->(Identifier) }
(TypeParameters)
(Empty))
(Constructor
(Empty)
{ (Identifier)
->(Identifier) }
(TypeParameters
(StrictTypeVariable
(Identifier))))
(Empty))))

View File

@ -354,4 +354,17 @@
(Identifier)
(TypeParameters
(Identifier)))
(Empty))
(Datatype
(Empty)
(Type
(Identifier)
(TypeParameters)
(Empty))
(Constructor
(Empty)
(Identifier)
(TypeParameters
(StrictTypeVariable
(Identifier))))
(Empty))))

View File

@ -354,4 +354,17 @@
(Identifier)
(TypeParameters
(Identifier)))
(Empty))
(Datatype
(Empty)
(Type
(Identifier)
(TypeParameters)
(Empty))
(Constructor
(Empty)
(Identifier)
(TypeParameters
(StrictTypeVariable
(Identifier))))
(Empty))))