numbers with bases
This commit is contained in:
parent
e13cd50175
commit
38ecabdda8
2 changed files with 61 additions and 30 deletions
|
@ -105,16 +105,29 @@ tests = "lexer" :- [
|
|||
acceptsWith' "'a" [Symbol "a"],
|
||||
acceptsWith' "'ab" [Symbol "ab"],
|
||||
acceptsWith' "'_b" [Symbol "_b"],
|
||||
rejects' "'"
|
||||
rejects' "'",
|
||||
rejects' "1abc"
|
||||
],
|
||||
|
||||
"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"
|
||||
acceptsWith' "0" [N Zero],
|
||||
acceptsWith' "1" [N One],
|
||||
acceptsWith' "2" [N $ Other 2],
|
||||
acceptsWith' "69" [N $ Other 69],
|
||||
acceptsWith' "1_000" [N $ Other 1000],
|
||||
acceptsWith' "0o0" [N Zero],
|
||||
acceptsWith' "0o105" [N $ Other 69],
|
||||
acceptsWith' "0O0" [N Zero],
|
||||
acceptsWith' "0O105" [N $ Other 69],
|
||||
acceptsWith' "0x0" [N Zero],
|
||||
acceptsWith' "0x45" [N $ Other 69],
|
||||
acceptsWith' "0xabc" [N $ Other 2748],
|
||||
acceptsWith' "0xABC" [N $ Other 2748],
|
||||
acceptsWith' "0xA_BC" [N $ Other 2748],
|
||||
acceptsWith' "0X0" [N Zero],
|
||||
acceptsWith' "0X45" [N $ Other 69],
|
||||
acceptsWith' "0XABC" [N $ Other 2748],
|
||||
rejects' "1_",
|
||||
rejects' "1__000"
|
||||
]
|
||||
]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue