rename Token Identifier to IDENTIFIER
This commit is contained in:
parent
5d49da69a6
commit
e5baa701b2
@ -11,9 +11,9 @@ testEmptyComment = TestCase $ assertEqual "scan '/*x*/'" emptyTokenList $ alex
|
||||
testLineComment = TestCase $ assertEqual "scan '// comment'" emptyTokenList $ alexScanTokens "// comment"
|
||||
testLineCommentEnds = TestCase $ assertEqual "scan '// com\\n'" emptyTokenList $ alexScanTokens "// com\n"
|
||||
|
||||
testIdentifier = TestCase $ assertEqual "scan 'identifier'" [Identifier "identifier"] $ alexScanTokens "identifier"
|
||||
testShortIdentifier = TestCase $ assertEqual "scan 'i'" [Identifier "i"] $ alexScanTokens "i"
|
||||
testIdentifierWithNumber = TestCase $ assertEqual "scan 'i2'" [Identifier "i2"] $ alexScanTokens "i2"
|
||||
testIdentifier = TestCase $ assertEqual "scan 'identifier'" [IDENTIFIER "identifier"] $ alexScanTokens "identifier"
|
||||
testShortIdentifier = TestCase $ assertEqual "scan 'i'" [IDENTIFIER "i"] $ alexScanTokens "i"
|
||||
testIdentifierWithNumber = TestCase $ assertEqual "scan 'i2'" [IDENTIFIER "i2"] $ alexScanTokens "i2"
|
||||
|
||||
testKeywordBreak = TestCase $ assertEqual "scan 'break'" [BREAK] $ alexScanTokens "break"
|
||||
testKeywordInt = TestCase $ assertEqual "scan 'int'" [INT] $ alexScanTokens "int"
|
||||
|
@ -65,7 +65,9 @@ tokens :-
|
||||
"volatile" { \_ -> VOLATILE}
|
||||
"while" { \_ -> WHILE}
|
||||
-- end keywords
|
||||
$JavaLetter$JavaLetterOrDigit* { \s -> Identifier s }
|
||||
$JavaLetter$JavaLetterOrDigit* { \s -> IDENTIFIER s }
|
||||
-- Literals
|
||||
|
||||
|
||||
{
|
||||
data Token
|
||||
@ -119,7 +121,8 @@ data Token
|
||||
| VOID
|
||||
| VOLATILE
|
||||
| WHILE
|
||||
| Identifier String
|
||||
| IDENTIFIER String
|
||||
|
||||
deriving(Eq,Show)
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user