Comments
A comment starts with// and runs to the end of the line. There are no block comments.
Whitespace and statements
Whitespace and line breaks don’t matter, and statements need no separator. Both of these scripts are valid:Identifiers
Names of variables, object properties, parameters and resources are identifiers. An identifier starts with a letter or underscore, followed by any number of letters, digits or underscores. Identifiers are case-sensitive, sototal and Total are different names.
Reserved keywords
These words can’t be used as identifiers:request contract var const return if else true false null
Type names such as int32 and string are not reserved.
Number literals
Numbers are written as decimal digits, optionally with a fractional part:- Write negative numbers with the unary minus operator:
-5. - A leading dot isn’t allowed: write
0.5, not.5. - There is no exponent notation (
1e5), hexadecimal (0xFF) or digit separator (1_000).
int32, larger whole numbers are int64, and numbers with a fractional part are decimal. See Types.
String literals
Strings use double quotes and must fit on a single line.
Strings can embed expressions with
${...}:
Other literals
- Booleans:
trueandfalse. - Null:
null. - Objects:
{ name: "Ada", age: 36 }. - Lists:
[1, 2, 3].