Language Features

A list of all syntax elements available in the language.

Syntax will be described in the following format:

Type
Description

Input

The input type written in percent % signs.

Literal

The raw characters.

Required Space

An underscore _ character.

Repetition

Three period ... characters.

New lines must be respected. Spaces are typically optional but occasionally required.

Variable Use

Get the variable value.

%name%

Examples

var = 10
if var == 10 /print {var}

Variable Assignment

Set the variable (L) to the result of the statement (R).

%name%=%statement%

Examples

name = "BaeFell"
age = 10
word = "hello"
var = word
sum = 5 + 5
first = second = "hello"

Structure

Creates a data object with given properties. MUST be followed by a block. The block must contain ONLY variable assignment root statements.

Examples

Sum

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.

Examples

Compare

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.

Symbol
Operation

<=

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.

Examples

String Literal

A (semi-literal) text value. This supports interpolation using the { and } brackets.

Examples

Boolean Literal

A literal true/false value.

Examples

Property Getter

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.

Examples

Property Setter

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).

Examples

Selector

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.

Examples

Script Literal

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.

Examples

Run

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.

Examples

Syntax

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.

Examples

Import

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).

Examples

Require

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.

Examples

Null Literal

An empty (nothing) value.

Examples

Map Literal

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.

Examples

List Literal

A list of values.

Examples

Kind Literal

A type reference. Please note that 'kinds' are approximate (rather than definite) types.

Examples

Inversion

Converts the following statement to a boolean value and inverts this.

Examples

Interpolation

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.

Examples

If Statement

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.

Examples

While Statement

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.

Examples

Function Statement

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.

Examples

Do 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.

Examples

For Statement

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.

Examples

Command Statement

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.

Examples

Block Open

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.

Examples

Block Close

Closes a block and returns to its previous parsing task.

This MUST be placed on its own line. This must follow a block opening.

Examples

Assertion

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.

Examples

Last updated