O Language/API/Tokens

From OnixOS
Revision as of 07:32, 25 August 2026 by Tedaryum (talk | contribs) (Protected "O Language/API/Tokens" ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite)))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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.