collapseos/blk/005

13 lines
422 B
Plaintext
Raw Normal View History

2020-05-22 20:39:28 -04:00
Number literals
Traditional Forth often use HEX/DEC switches to go from decimal
to hexadecimal parsing. Collapse OS parses literals in a way
that is closer to C.
Straight numbers are decimals, numbers starting with "0x"
are hexadecimals (example "0x12ef"), "0b" prefixes indicate
binary (example "0b1010"), char literals are single characters
surrounded by ' (example 'X'). Char literals can't be used for
whitespaces.