decimal numbers
This commit is contained in:
parent
699c6a5ca1
commit
fa5beb4e2b
2 changed files with 51 additions and 5 deletions
|
@ -77,12 +77,12 @@ tests = "lexer" :- [
|
|||
|
||||
"punctuation" :- [
|
||||
acceptsWith' "({[:,::]})"
|
||||
[P LParen, P LBrace, P LSquare,
|
||||
P Colon, P Comma, P DblColon,
|
||||
[P LParen, P LBrace, P LSquare,
|
||||
P Colon, P Comma, P DblColon,
|
||||
P RSquare, P RBrace, P RParen],
|
||||
acceptsWith' " ( { [ : , :: ] } ) "
|
||||
[P LParen, P LBrace, P LSquare,
|
||||
P Colon, P Comma, P DblColon,
|
||||
[P LParen, P LBrace, P LSquare,
|
||||
P Colon, P Comma, P DblColon,
|
||||
P RSquare, P RBrace, P RParen],
|
||||
acceptsWith' "-> → => ⇒ ** × << ⊲ ∷"
|
||||
[P Arrow, P Arrow, P DblArrow, P DblArrow,
|
||||
|
@ -99,11 +99,22 @@ tests = "lexer" :- [
|
|||
acceptsWith' "abc'" [Name "abc'"],
|
||||
acceptsWith' "a'b'c''" [Name "a'b'c''"],
|
||||
acceptsWith' "abc123" [Name "abc123"],
|
||||
acceptsWith' "_1" [Name "_1"],
|
||||
acceptsWith' "ab cd" [Name "ab", Name "cd"],
|
||||
acceptsWith' "ab{--}cd" [Name "ab", Name "cd"],
|
||||
acceptsWith' "'a" [Symbol "a"],
|
||||
acceptsWith' "'ab" [Symbol "ab"],
|
||||
acceptsWith' "'_b" [Symbol "_b"],
|
||||
rejects' "'"
|
||||
],
|
||||
|
||||
"numbers" :- [
|
||||
acceptsWith' "0" [N Zero],
|
||||
acceptsWith' "1" [N One],
|
||||
acceptsWith' "2" [N $ Other 2],
|
||||
acceptsWith' "69" [N $ Other 69],
|
||||
acceptsWith' "1_000" [N $ Other 1000],
|
||||
todo "octal",
|
||||
todo "hex"
|
||||
]
|
||||
]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue