O Language/API/Tokens
From OnixOS
Tokens and Operators
Literals
| Token | Example |
|---|---|
| Identifier | name
|
| Integer | 42
|
| Float | 3.14
|
| String | "hello"
|
| Boolean | true, false
|
Comments start with # and continue to the end of the source input.
Operators and delimiters
Arithmetic operators are +, -, *, and /. Comparisons use ==, !=, <, >, <=, and >=. Boolean negation uses !. Scope member access uses ->.
Parentheses group expressions and function arguments. Braces delimit blocks and hashes. Brackets delimit arrays and indexes. Commas separate items, colons separate hash keys and values, and semicolons separate statements.
Keywords
fn, def, true, false, if, else, return, print, load, loop, scope, proc, env, sock, for, in, self, literal, begin, except, recover, final, float, route, set, impl, signal, eval, async, wait, and while.
