Expressions
Expressions evaluate to a value and may either be function calls, literals or identifiers.
Expression = FunctionCall | Operand | Cast ;
Function Calls
Function calls consist of the function name (optionally fully qualified) and operand arguments. Function calls may not be nested.
FunctionCall = FunctionId '(' [ Operands ] ')' ';'
FunctionId = '@' Identifier [ '.' Identifier ] ;
Function calls are pass-by-value and return by value.
Operands
Operands, used either as parameters or return values, may only be identifiers or literals.
Operands = Operand { ',' Operand } ;
Operand = Identifier [ '.' Identifier ] | Literal ;
Literals
Literals may either be function names, or vectors and consist of the value and associated type. Function literals may omit the declared type.
Literal = FunctionLiteral | VectorLiteral ;
FunctionLiteral = FunctionId [ ':' "func" ] ;
VectorLiteral = Value ':' Type | '(' Value { ',' Value } ')' ':' Type ;
Values within a vector literal must correspond to the declared type (or be compatible, see type conversions).
Cast Expression
A type cast changes the type of the expression to the destination type. See type conversions for more details.
Cast = "check_cast" '(' Expression ',' Type ')' ;