Scripting language

Scripting language

MSE uses a custom scripting language to add complicated behaviour to fields and styles.


See also:

Syntax index

#comment Comments ignored by the parser
123 A literal number
"stuff" A literal string
[a,b,c] A literal list
[a:b, c:d] A literal map
{ expr } Function definition
fun(a:b, c:d) Function call
fun(value) Function call with 'input' argument
fun@(a:b) Default arguments
a.b Property 'b' of 'a'
a[b] Property 'value of b' of 'a'
-a Negation
a + b Addition / concatenation
a - b Subtraction
a * b Multiplication
a / b Floating point division
a div b Integer division
a mod b Remainder
a ^ b Exponentiation
not a Boolean not
a and b Boolean conjunction
a or b Boolean disjunction
a xor b Boolean xor
a == b Comparison for equality
a != b Comparison for inequality
a < b Comparison
a > b Comparison
a <= b Comparison
a >= b Comparison
a or else b Use a unless it is an error, then use b instead.
min(a,b,c,...) Smallest of the values
max(a,b,c,...) Largest of the values
rgb(r,g,b) A color value
rgba(r,g,b) A color value with transparency
if x then y Conditional expresion
if x then y else z Conditional expresion
for x in list do y Loop over elements in a list
for x from a to b do y Loop over numbers from a to b