Lexical structure
Comments and white space
Section titled “Comments and white space”// starts a comment that runs to the end of the line. /* starts a comment that ends at the first */. Block comments do not nest, and one that is never closed is a compile error (E-UNTERMINATED-COMMENT).
Comments can carry type annotations for the editor. The compiler ignores them. See type annotations.
A name is [A-Za-z_][A-Za-z0-9_]*.
- Variable names are case-sensitive:
temp.Fooandtemp.fooare two variables. - Function names, event names, built-in names, object types, and keywords are not case-sensitive:
onActionServerSideandonactionserversideare the same function.
Keywords
Section titled “Keywords”function public private return if else while do for break continue switch case defaultwith new import enum const true false null NULL SPC NL TAB intry catch finally throw async awaitKeywords are matched without regard to case. This is an extension: older servers accept only lowercase keywords and built-in names (OQ-LANG-3), so write them in lowercase in scripts that must also run there. The words try, catch, finally, throw, async, and await are keywords only where the grammar expects them. Everywhere else they are ordinary names, so an older script that uses try as a variable still compiles.
pi is a constant, not a keyword.
Numbers
Section titled “Numbers”- Decimal:
123,1.5,.5, and5.. - Hexadecimal:
0x1F. The value is an integer. - Exponent:
1e2,1.5e1,1e-2. The exponent needs a digit, so1eis the number1followed by the namee. - No octal (
007is7), no binary, no digit separators.
A number literal is a 64-bit floating point value. A leading - is the unary minus operator, not part of the literal.
function onCreated() { echo(0x1F + 1); // expect: 32 echo(1e2); // expect: 100 echo(007); // expect: 7}Run this example in the playground
Strings
Section titled “Strings”Strings are written in double quotes. There are no single-quoted strings. The escapes are:
| Escape | Meaning |
|---|---|
\n |
new line |
\t |
tab |
\r |
carriage return |
\\ |
a backslash |
\" |
a double quote |
\' |
a single quote |
Any other \x gives the character x without the backslash (OQ-LANG-6). A raw new line inside a double-quoted string is part of the string (a string with a \ before the new line gets the same new line), so a text can span lines. A string that is never closed runs to the end of the file and is a compile error (E-UNTERMINATED-STRING). Two string literals next to each other are not joined; use @.
function onCreated() { echo("say \"hi\""); // expect: say "hi" echo("a" @ "b"); // expect: ab}Run this example in the playground
Strings are sequences of bytes. .length() counts bytes, and a text in UTF-8 uses more than one byte for most non-ASCII characters (OQ-LANG-1).
Operators and punctuation
Section titled “Operators and punctuation”+ - * / % ^ ++ -- = += -= *= /= %= @= &= |= <<= >>=== != === !== < > <= >= && || ! & | << >>@ ? : ; , . ( ) [ ] { }^is power. There is no^=.=<and=>are the legacy spellings of<=and>=.~is the bitwise complement andxorthe bitwise exclusive or (see operators).===and!==are engine extensions (see operators).SPC,NL, andTABare operators written as words. They join two texts with a space, a new line, or a tab.
Engine version 0.1.0. Built 2026-11-18.