Currently the only supported data type is number
(double precision float) type, like javascript's number
type.
Bitwise operations are not supported since they can be emulated and very slow anyways.
+
: Addition-
: Subtraction or Negative*
: Multiplication/
: Division%
: Remainder (integers only)
Important
Due to limitations addition and subtraction results cannot exceed 19999999
Important
Due to limitations multiplication and division results are 32 bit precision
>
: Greater than<
: Less than>=
: Greater or equal<=
: Less or equal==
: Equal!=
: Not equal!
: Not
Functions can receive arguments and return a value. They uses mcslib's ABI. It's not compatible with minecraft function arguments and return value.
When exporting, a function with the specified function name and argument names is created. Exported functions can be called with Minecraft function arguments.
- Caller creates a stack frame object inside storage
mcs:system
stack
- Fill function arguments
- Call the function
- Callee uses stack frame to allocate local variables and temporaries
- Remove stack frame object before return
if
, while
, loop
statements are supported.