Catspeak Reference


struct CatspeakGMLCompiler

function CatspeakGMLCompiler(
  ir : Struct,
  interface? : Struct,
) constructor { 
  // 5 fields omitted
}
🔬 This is an experimental feature. It may change at any moment.

Takes a reference to a Catspeak IR and converts it into a callable GML function.

⚠️ Warning

Do not modify the the Catspeak IR whilst compilation is taking place. This will cause undefined behaviour, potentially resulting in hard to discover bugs!

Arguments

  • ir

    The Catspeak IR to compile.

  • interface (optional)

    The native interface to use.

§ update

static update = function()
  -> Function

Generates the code for a single term from the supplied Catspeak IR.

Returns Function

The final compiled Catspeak function if there are no more terms left to compile, or undefined if there is still more left to compile.

Example

Creates a new CatspeakGMLCompiler from the variable ir and loops until the compiler is finished compiling. The final result is assigned to the result local variable.

var compiler = new CatspeakGMLCompiler(ir);
var result;
do {
    result = compiler.update();
} until (result != undefined);