Notation

The syntax is specified using Extended Backus-Naur Form (EBNF).

Productions

production_name = expression .

Productions are expressions terminated by ..

Operators

NotationMeaning
a bSequence
a | bAlternation
[ a ]Optional (0 or 1)
{ a }Repetition (0 or more)
( a )Grouping
"x"Literal keyword
'c'Literal character
'a' … 'z'Character range (inclusive)

Naming

StyleUsage
lower_caseProduction names
PascalCaseType names
snake_caseFunctions, variables

Terminology

TermMeaning
mustAbsolute requirement
must notAbsolute prohibition
mayOptional
errorCompile-time failure
panicRun-time failure

Examples

Valid:

@add (a: int, b: int) -> int = a + b

Invalid:

@add (a: int, b: int) = a + b  // error: missing return type