-
Notifications
You must be signed in to change notification settings - Fork 0
Language Tour
hunterdyar edited this page Jun 9, 2024
·
2 revisions
Single line comments begin with //
//Comments
Multi line comments begin with /*
and end with */
.
/* This is a
multi line
comment
*/
String literals are defined with '
or "
.
"This is a string literal."
'This is also a string literal.'
"string's"
"escape \" with backslash. Whatever character immediately follows the backslash will be parsed as a part of the string."
Numbers begin with a digit or a dot, and contain digits or the period.
10 10.0 .1
They will be parsed as integers. (note: floats not yet supported)
Scrub parses hex, binary, and octal literals at compile time.
0xFF
0xff
0b001010
0o17
0x
prefix for hexadecimal (case doesn't matter). 0b
prefix for binary. 0o
for octal.
The keywords true
and false
are parsed as bools.
Array's use a square bracket notation. Create arrays with a comma separated list of values inside of brackets. Access an array with an indexer inside the bracket immediately after the array identifier.
Arrays are zero-indexed.
array = [1,2,"three"]
array[2]//"three"