1
1
mirror of https://github.com/github/semantic.git synced 2024-12-27 08:54:14 +03:00

Assing Literal.TextElement

This commit is contained in:
Rick Winfrey 2017-05-16 14:26:43 -07:00
parent afb9fb5ab2
commit 3d4ff47d5d

View File

@ -24,6 +24,7 @@ type Syntax' =
, Literal.Float
, Literal.Integer
, Literal.String
, Literal.TextElement
, Statement.If
, Statement.Import
, Statement.Return
@ -53,8 +54,9 @@ identifier = makeTerm <$> symbol Identifier <*> (Syntax.Identifier <$> source)
literal :: HasCallStack => Assignment (Node Grammar) (Term Syntax Location)
literal = string <|> integer <|> float <|> boolean
-- TODO: Wrap `Literal.TextElement` with a `Litera.String`
string :: HasCallStack => Assignment (Node Grammar) (Term Syntax Location)
string = makeTerm <$> symbol String <*> (Syntax.Empty <$ source)
string = makeTerm <$> symbol String <*> (Literal.TextElement <$> source)
float :: HasCallStack => Assignment (Node Grammar) (Term Syntax Location)
float = makeTerm <$> symbol Float <*> (Literal.Float <$> source)