Repository navigation
Language Syntax
Frank edited this page Jan 25, 2026
·
12 revisions
CupidScript uses a C-like surface syntax.
Supported comment forms:
// line comment
/* block comment */Comments are skipped by the lexer alongside whitespace.
- Start: letter or
_ - Continue: letters, digits,
_
Decimal-only integers:
0
12345Double-quoted strings:
"hello"
"with \n escapes"
"quote: \""
"backslash: \\"Escape handling (in runtime unescape):
-
\n,\t,\r,\",\\ - Any unknown escape
\xbecomes literalx
( ) [ ] { } , ; .
Assignment:
=
Arithmetic:
+ - * / %
Unary:
! -
Comparison:
== != < <= > >=
Boolean:
&& ||
- Primary: literals, identifiers, parenthesized
(expr) - Postfix: calls
f(...), indexinga[b] - Unary:
!expr,-expr - Multiplicative:
* / % - Additive:
+ - - Comparison:
< <= > >= - Equality:
== != - AND:
&& - OR:
||