Language Features
A list of all syntax elements available in the language.
Last updated
A list of all syntax elements available in the language.
Last updated
Syntax will be described in the following format:
Type | Description |
---|---|
New lines must be respected. Spaces are typically optional but occasionally required.
Get the variable value.
Set the variable (L) to the result of the statement (R).
Creates a data object with given properties. MUST be followed by a block. The block must contain ONLY variable assignment root statements.
Return the sum of the statement (L) and the statement (R). If either statement is a non-numerical value the result will be null
.
The +
operator will attempt to concatenate strings.
Return the comparison result of the statement (L) and the statement (R). This is typically a boolean. Some comparators can return a numerical or atypical object result.
A (semi-literal) text value. This supports interpolation using the {
and }
brackets.
A literal true/false value.
Retrieve a property from an object. This returns a value. If the property was unable to be found on the object the value will be null
. The property name must be literal.
Accesses a property in an object. This behaviour is somewhat ill-defined, since it may not alter the property. Some types may use setters to call unary methods, e.g. string[char_at=1]
calling string.charAt(1)
.
A selector in the Minecraft format, starting with the 'at' @
character. This supports interpolation using the {
and }
brackets.
This returns a list if multiple elements are selected or a single object if only one is found.
Please note domains are expected to override the selector to provide a relevant universe.
A script literal. The complete syntax must be an exact name of a loaded script. This defers to execution (to respect loading) but throws an error if no script is present.
Runs an executable, returning its result. Any key<->value data store can be provided as a starting variable map. The result of the executable is returned.
Defines syntax that will be available following this in the current script parser. Statement inputs are specified with %name%
where name
becomes a variable name available in the syntax statement.
The new syntax has a lower priority than built-in syntax constructs.
Acquires a resource from an external script. This runs the script and stores its result in the named variable.
This does NOT provide the script object, since this is already obtainable using the Script Literal syntax.
This is primarily designed for interfacing with native libraries (e.g. math
).
Asserts that the given variable keys are known. Their values may be null
, as long as they have been assigned in the context. This will attempt to pack anonymous arguments into the variable keys if none are present.
This is designed for input checking of functions and sub-scripts.
An empty (nothing) value.
A map of key <-> value pairs. This is analogous to a structure but lacks the utility.
There is NO empty map literal []
since this is indiscernible from an empty list.
A list of values.
A type reference. Please note that 'kinds' are approximate (rather than definite) types.
Converts the following statement to a boolean value and inverts this.
A helper copy of string interpolation for use in code. This is added only for parity and has no necessary use. This may assist with order of operations.
Converts a check statement (L) to a boolean value. If this value equates to true, runs an action statement (R). If the value is not true the action statement will be skipped. A block start {
is permitted after this.
Converts a check statement (L) to a boolean value. If this value equates to true, runs an action statement (R).
This will be repeated until the result of the check statement equates to false.
A block start {
is permitted after this.
Creates an executable object that can be run under control. This is designed to be followed by a block section.
Root variables are unavailable in functions - they must be provided in the run
statement.
Internally, this simply returns raw child statement.
Runs a statement (R) in the context of an object (L). The properties of the object are available as keywords local to the area. A block start {
is permitted after this.
Consumes a list of values, assigning each one to a variable (L). For each value, runs an action statement (R). If the list of values is empty the action statement will not be run. A block start {
is permitted after this.
Executes a Minecraft command from the context of the script runner. This supports interpolation using the {
and }
brackets. The result of this is typically a boolean value, determining whether the command executed correctly.
The script runner will receive any text output or effects of the command.
Opens a block. This hijacks the parser to combine the following lines into a single executable statement.
Nothing may follow the opening character in the same line.
Closes a block and returns to its previous parsing task.
This MUST be placed on its own line. This must follow a block opening.
Evaluates the result of a statement as a boolean. If the value is true, returns true.
If the value is false, this throws an error and terminates the running of the script.
Symbol | Operation |
---|---|
Input
The input type written in percent %
signs.
Literal
The raw characters.
Required Space
An underscore _
character.
Repetition
Three period ...
characters.
<=
Less than or equal to.
<
Less than.
>=
Greater than or equal to.
>
Greater than
&
And.
|
Or.
^
Exclusive or.
?
Alternatively (if null).
==
Equal to.
!=
Not equal to.