1
1
mirror of https://github.com/github/semantic.git synced 2024-11-28 01:47:01 +03:00

Assign character literals

This commit is contained in:
Rick Winfrey 2018-05-24 14:58:54 -07:00
parent 1da6cec06e
commit d86a41f17c
7 changed files with 748 additions and 21 deletions

View File

@ -24,6 +24,7 @@ import Prologue
type Syntax = '[
Comment.Comment
, Declaration.Function
, Literal.Character
, Literal.Float
, Literal.Integer
, Syntax.Context
@ -55,7 +56,8 @@ expression = term (handleError (choice expressionChoices))
expressionChoices :: [Assignment.Assignment [] Grammar Term]
expressionChoices = [
comment
character
, comment
, constructorIdentifier
, float
, functionDeclaration
@ -101,6 +103,9 @@ integer = makeTerm <$> symbol Integer <*> (Literal.Integer <$> source)
float :: Assignment
float = makeTerm <$> symbol Float <*> (Literal.Float <$> source)
character :: Assignment
character = makeTerm <$> symbol Char <*> (Literal.Character <$> source)
-- | Match a series of terms or comments until a delimiter is matched.
manyTermsTill :: Assignment.Assignment [] Grammar Term -> Assignment.Assignment [] Grammar b -> Assignment.Assignment [] Grammar [Term]
manyTermsTill step = manyTill (step <|> comment)

View File

@ -35,3 +35,36 @@ aZ' = undefined
a = True
a = False
a = 'a'
a = 'b'
a = '0'
a = '1'
a = '_'
a = 'A'
a = 'B'
a = ','
a = '!'
a = '#'
a = '$'
a = '%'
a = '&'
a = '⋆'
a = '+'
a = '.'
a = '/'
a = '<'
a = '='
a = '>'
a = '?'
a = '^'
a = '|'
a = '-'
a = '~'
a = ':'
a = '"'

View File

@ -35,3 +35,36 @@ bZ' = undefined
b = True
b = False
b = 'a'
b = 'b'
b = '0'
b = '1'
b = '_'
b = 'A'
b = 'B'
b = ','
b = '!'
b = '#'
b = '$'
b = '%'
b = '&'
b = '⋆'
b = '+'
b = '.'
b = '/'
b = '<'
b = '='
b = '>'
b = '?'
b = '^'
b = '|'
b = '-'
b = '~'
b = ':'
b = '"'

View File

@ -1,11 +1,10 @@
(Module
(Identifier)
(
(Function
{ (Identifier)
->(Identifier) }
(
(Integer)))
{+(Function
{+(Identifier)+}
{+(
{+(Integer)+})+})+}
{+(Function
{+(Identifier)+}
{+(
@ -118,6 +117,118 @@
{+(Identifier)+}
{+(
{+(Identifier)+})+})+}
{+(Function
{+(Identifier)+}
{+(
{+(Character)+})+})+}
{+(Function
{+(Identifier)+}
{+(
{+(Character)+})+})+}
{+(Function
{+(Identifier)+}
{+(
{+(Character)+})+})+}
{+(Function
{+(Identifier)+}
{+(
{+(Character)+})+})+}
{+(Function
{+(Identifier)+}
{+(
{+(Character)+})+})+}
{+(Function
{+(Identifier)+}
{+(
{+(Character)+})+})+}
{+(Function
{+(Identifier)+}
{+(
{+(Character)+})+})+}
{+(Function
{+(Identifier)+}
{+(
{+(Character)+})+})+}
{+(Function
{+(Identifier)+}
{+(
{+(Character)+})+})+}
{+(Function
{+(Identifier)+}
{+(
{+(Character)+})+})+}
{+(Function
{+(Identifier)+}
{+(
{+(Character)+})+})+}
{+(Function
{+(Identifier)+}
{+(
{+(Character)+})+})+}
{+(Function
{+(Identifier)+}
{+(
{+(Character)+})+})+}
{+(Function
{+(Identifier)+}
{+(
{+(Character)+})+})+}
{+(Function
{+(Identifier)+}
{+(
{+(Character)+})+})+}
{+(Function
{+(Identifier)+}
{+(
{+(Character)+})+})+}
{+(Function
{+(Identifier)+}
{+(
{+(Character)+})+})+}
{+(Function
{+(Identifier)+}
{+(
{+(Character)+})+})+}
{+(Function
{+(Identifier)+}
{+(
{+(Character)+})+})+}
{+(Function
{+(Identifier)+}
{+(
{+(Character)+})+})+}
{+(Function
{+(Identifier)+}
{+(
{+(Character)+})+})+}
{+(Function
{+(Identifier)+}
{+(
{+(Character)+})+})+}
{+(Function
{+(Identifier)+}
{+(
{+(Character)+})+})+}
{+(Function
{+(Identifier)+}
{+(
{+(Character)+})+})+}
{+(Function
{+(Identifier)+}
{+(
{+(Character)+})+})+}
{+(Function
{+(Identifier)+}
{+(
{+(Character)+})+})+}
{+(Function
{+(Identifier)+}
{+(
{+(Character)+})+})+}
{-(Function
{-(Identifier)-}
{-(
{-(Integer)-})-})-}
{-(Function
{-(Identifier)-}
{-(
@ -229,4 +340,112 @@
{-(Function
{-(Identifier)-}
{-(
{-(Identifier)-})-})-}))
{-(Identifier)-})-})-}
{-(Function
{-(Identifier)-}
{-(
{-(Character)-})-})-}
{-(Function
{-(Identifier)-}
{-(
{-(Character)-})-})-}
{-(Function
{-(Identifier)-}
{-(
{-(Character)-})-})-}
{-(Function
{-(Identifier)-}
{-(
{-(Character)-})-})-}
{-(Function
{-(Identifier)-}
{-(
{-(Character)-})-})-}
{-(Function
{-(Identifier)-}
{-(
{-(Character)-})-})-}
{-(Function
{-(Identifier)-}
{-(
{-(Character)-})-})-}
{-(Function
{-(Identifier)-}
{-(
{-(Character)-})-})-}
{-(Function
{-(Identifier)-}
{-(
{-(Character)-})-})-}
{-(Function
{-(Identifier)-}
{-(
{-(Character)-})-})-}
{-(Function
{-(Identifier)-}
{-(
{-(Character)-})-})-}
{-(Function
{-(Identifier)-}
{-(
{-(Character)-})-})-}
{-(Function
{-(Identifier)-}
{-(
{-(Character)-})-})-}
{-(Function
{-(Identifier)-}
{-(
{-(Character)-})-})-}
{-(Function
{-(Identifier)-}
{-(
{-(Character)-})-})-}
{-(Function
{-(Identifier)-}
{-(
{-(Character)-})-})-}
{-(Function
{-(Identifier)-}
{-(
{-(Character)-})-})-}
{-(Function
{-(Identifier)-}
{-(
{-(Character)-})-})-}
{-(Function
{-(Identifier)-}
{-(
{-(Character)-})-})-}
{-(Function
{-(Identifier)-}
{-(
{-(Character)-})-})-}
{-(Function
{-(Identifier)-}
{-(
{-(Character)-})-})-}
{-(Function
{-(Identifier)-}
{-(
{-(Character)-})-})-}
{-(Function
{-(Identifier)-}
{-(
{-(Character)-})-})-}
{-(Function
{-(Identifier)-}
{-(
{-(Character)-})-})-}
{-(Function
{-(Identifier)-}
{-(
{-(Character)-})-})-}
{-(Function
{-(Identifier)-}
{-(
{-(Character)-})-})-}
{-(Function
{-(Identifier)-}
{-(
{-(Character)-})-})-}))

View File

@ -1,11 +1,10 @@
(Module
(Identifier)
(
(Function
{ (Identifier)
->(Identifier) }
(
(Integer)))
{+(Function
{+(Identifier)+}
{+(
{+(Integer)+})+})+}
{+(Function
{+(Identifier)+}
{+(
@ -102,12 +101,6 @@
{+(Identifier)+}
{+(
{+(Identifier)+})+})+}
(Function
{ (Identifier)
->(Identifier) }
(
{+(Identifier)+}
{-(Integer)-}))
{+(Function
{+(Identifier)+}
{+(
@ -120,6 +113,126 @@
{+(Identifier)+}
{+(
{+(Identifier)+})+})+}
{+(Function
{+(Identifier)+}
{+(
{+(Identifier)+})+})+}
{+(Function
{+(Identifier)+}
{+(
{+(Character)+})+})+}
{+(Function
{+(Identifier)+}
{+(
{+(Character)+})+})+}
{+(Function
{+(Identifier)+}
{+(
{+(Character)+})+})+}
{+(Function
{+(Identifier)+}
{+(
{+(Character)+})+})+}
{+(Function
{+(Identifier)+}
{+(
{+(Character)+})+})+}
{+(Function
{+(Identifier)+}
{+(
{+(Character)+})+})+}
{+(Function
{+(Identifier)+}
{+(
{+(Character)+})+})+}
{+(Function
{+(Identifier)+}
{+(
{+(Character)+})+})+}
{+(Function
{+(Identifier)+}
{+(
{+(Character)+})+})+}
{+(Function
{+(Identifier)+}
{+(
{+(Character)+})+})+}
{+(Function
{+(Identifier)+}
{+(
{+(Character)+})+})+}
{+(Function
{+(Identifier)+}
{+(
{+(Character)+})+})+}
{+(Function
{+(Identifier)+}
{+(
{+(Character)+})+})+}
{+(Function
{+(Identifier)+}
{+(
{+(Character)+})+})+}
{+(Function
{+(Identifier)+}
{+(
{+(Character)+})+})+}
{+(Function
{+(Identifier)+}
{+(
{+(Character)+})+})+}
{+(Function
{+(Identifier)+}
{+(
{+(Character)+})+})+}
{+(Function
{+(Identifier)+}
{+(
{+(Character)+})+})+}
{+(Function
{+(Identifier)+}
{+(
{+(Character)+})+})+}
{+(Function
{+(Identifier)+}
{+(
{+(Character)+})+})+}
{+(Function
{+(Identifier)+}
{+(
{+(Character)+})+})+}
{+(Function
{+(Identifier)+}
{+(
{+(Character)+})+})+}
{+(Function
{+(Identifier)+}
{+(
{+(Character)+})+})+}
{+(Function
{+(Identifier)+}
{+(
{+(Character)+})+})+}
{+(Function
{+(Identifier)+}
{+(
{+(Character)+})+})+}
{+(Function
{+(Identifier)+}
{+(
{+(Character)+})+})+}
{+(Function
{+(Identifier)+}
{+(
{+(Character)+})+})+}
{-(Function
{-(Identifier)-}
{-(
{-(Integer)-})-})-}
{-(Function
{-(Identifier)-}
{-(
{-(Integer)-})-})-}
{-(Function
{-(Identifier)-}
{-(
@ -227,4 +340,112 @@
{-(Function
{-(Identifier)-}
{-(
{-(Identifier)-})-})-}))
{-(Identifier)-})-})-}
{-(Function
{-(Identifier)-}
{-(
{-(Character)-})-})-}
{-(Function
{-(Identifier)-}
{-(
{-(Character)-})-})-}
{-(Function
{-(Identifier)-}
{-(
{-(Character)-})-})-}
{-(Function
{-(Identifier)-}
{-(
{-(Character)-})-})-}
{-(Function
{-(Identifier)-}
{-(
{-(Character)-})-})-}
{-(Function
{-(Identifier)-}
{-(
{-(Character)-})-})-}
{-(Function
{-(Identifier)-}
{-(
{-(Character)-})-})-}
{-(Function
{-(Identifier)-}
{-(
{-(Character)-})-})-}
{-(Function
{-(Identifier)-}
{-(
{-(Character)-})-})-}
{-(Function
{-(Identifier)-}
{-(
{-(Character)-})-})-}
{-(Function
{-(Identifier)-}
{-(
{-(Character)-})-})-}
{-(Function
{-(Identifier)-}
{-(
{-(Character)-})-})-}
{-(Function
{-(Identifier)-}
{-(
{-(Character)-})-})-}
{-(Function
{-(Identifier)-}
{-(
{-(Character)-})-})-}
{-(Function
{-(Identifier)-}
{-(
{-(Character)-})-})-}
{-(Function
{-(Identifier)-}
{-(
{-(Character)-})-})-}
{-(Function
{-(Identifier)-}
{-(
{-(Character)-})-})-}
{-(Function
{-(Identifier)-}
{-(
{-(Character)-})-})-}
{-(Function
{-(Identifier)-}
{-(
{-(Character)-})-})-}
{-(Function
{-(Identifier)-}
{-(
{-(Character)-})-})-}
{-(Function
{-(Identifier)-}
{-(
{-(Character)-})-})-}
{-(Function
{-(Identifier)-}
{-(
{-(Character)-})-})-}
{-(Function
{-(Identifier)-}
{-(
{-(Character)-})-})-}
{-(Function
{-(Identifier)-}
{-(
{-(Character)-})-})-}
{-(Function
{-(Identifier)-}
{-(
{-(Character)-})-})-}
{-(Function
{-(Identifier)-}
{-(
{-(Character)-})-})-}
{-(Function
{-(Identifier)-}
{-(
{-(Character)-})-})-}))

View File

@ -116,4 +116,112 @@
(Function
(Identifier)
(
(Identifier)))))
(Identifier)))
(Function
(Identifier)
(
(Character)))
(Function
(Identifier)
(
(Character)))
(Function
(Identifier)
(
(Character)))
(Function
(Identifier)
(
(Character)))
(Function
(Identifier)
(
(Character)))
(Function
(Identifier)
(
(Character)))
(Function
(Identifier)
(
(Character)))
(Function
(Identifier)
(
(Character)))
(Function
(Identifier)
(
(Character)))
(Function
(Identifier)
(
(Character)))
(Function
(Identifier)
(
(Character)))
(Function
(Identifier)
(
(Character)))
(Function
(Identifier)
(
(Character)))
(Function
(Identifier)
(
(Character)))
(Function
(Identifier)
(
(Character)))
(Function
(Identifier)
(
(Character)))
(Function
(Identifier)
(
(Character)))
(Function
(Identifier)
(
(Character)))
(Function
(Identifier)
(
(Character)))
(Function
(Identifier)
(
(Character)))
(Function
(Identifier)
(
(Character)))
(Function
(Identifier)
(
(Character)))
(Function
(Identifier)
(
(Character)))
(Function
(Identifier)
(
(Character)))
(Function
(Identifier)
(
(Character)))
(Function
(Identifier)
(
(Character)))
(Function
(Identifier)
(
(Character)))))

View File

@ -116,4 +116,112 @@
(Function
(Identifier)
(
(Identifier)))))
(Identifier)))
(Function
(Identifier)
(
(Character)))
(Function
(Identifier)
(
(Character)))
(Function
(Identifier)
(
(Character)))
(Function
(Identifier)
(
(Character)))
(Function
(Identifier)
(
(Character)))
(Function
(Identifier)
(
(Character)))
(Function
(Identifier)
(
(Character)))
(Function
(Identifier)
(
(Character)))
(Function
(Identifier)
(
(Character)))
(Function
(Identifier)
(
(Character)))
(Function
(Identifier)
(
(Character)))
(Function
(Identifier)
(
(Character)))
(Function
(Identifier)
(
(Character)))
(Function
(Identifier)
(
(Character)))
(Function
(Identifier)
(
(Character)))
(Function
(Identifier)
(
(Character)))
(Function
(Identifier)
(
(Character)))
(Function
(Identifier)
(
(Character)))
(Function
(Identifier)
(
(Character)))
(Function
(Identifier)
(
(Character)))
(Function
(Identifier)
(
(Character)))
(Function
(Identifier)
(
(Character)))
(Function
(Identifier)
(
(Character)))
(Function
(Identifier)
(
(Character)))
(Function
(Identifier)
(
(Character)))
(Function
(Identifier)
(
(Character)))
(Function
(Identifier)
(
(Character)))))