Versions in this module Expand all Collapse all v0 v0.2.2 Jun 8, 2025 v0.2.1 Jun 6, 2025 v0.2.0 Jun 1, 2025 Changes in this version type Code + func (c *Code) ExceptionFormat(messageParts ...nbt.Value) interfaces.IRCode + func (c *Code) ExceptionString(message string) interfaces.IRCode + func (c *Code) ExecReg(varName string) interfaces.IRCode v0.1.2 May 11, 2025 v0.1.1 May 11, 2025 Changes in this version type Code + func (c *Code) CallWithArgs(funcName, argPath string) interfaces.IRCode v0.1.0 May 11, 2025 Changes in this version + const AppendCopy + const AppendSet + const ArgPath + const Branch + const CALL + const Call + const Cmp + const Copy + const Func + const If + const Load + const Math + const MaxCallCounter + const RA + const RB + const RET + const RETF + const RX + const Raw + const Remove + const Ret + const Score + const Set + const Size + const Store + const StructPath + const Trace + const TraceScore + const TraceStorage + const Unless + const VarPath + func NewCode(namespace, storage string) interfaces.IRCode + func NewFunction(name string, code interfaces.IRCode) interfaces.Function + func OptimizeFunctionBody(f interfaces.Function) interfaces.Function + type Code struct + Instructions []interfaces.Instruction + Namespace string + func (c *Code) AddInstruction(inst interfaces.Instruction) interfaces.IRCode + func (c *Code) AppendCopy(listPath, valuePath string) interfaces.IRCode + func (c *Code) AppendSet(listPath string, value nbt.Value) interfaces.IRCode + func (c *Code) Branch(branchName, funcName string) interfaces.IRCode + func (c *Code) Call(funcName string) interfaces.IRCode + func (c *Code) Copy(from, to string) interfaces.IRCode + func (c *Code) CopyArg(varName, funcName, argName string) interfaces.IRCode + func (c *Code) CopyVar(from, to string) interfaces.IRCode + func (c *Code) DoubleAcos(x, to string) interfaces.IRCode + func (c *Code) DoubleAdd(x, y, to string) interfaces.IRCode + func (c *Code) DoubleAsin(x, to string) interfaces.IRCode + func (c *Code) DoubleAtan(x, to string) interfaces.IRCode + func (c *Code) DoubleAtan2(x, y, to string) interfaces.IRCode + func (c *Code) DoubleCeil(x, to string) interfaces.IRCode + func (c *Code) DoubleCompare(regRa, regRb string, operator interfaces.TokenType, res string) interfaces.IRCode + func (c *Code) DoubleCos(x, to string) interfaces.IRCode + func (c *Code) DoubleDiv(x, y, to string) interfaces.IRCode + func (c *Code) DoubleFloor(x, to string) interfaces.IRCode + func (c *Code) DoubleMod(x, y, to string) interfaces.IRCode + func (c *Code) DoubleMul(x, y, to string) interfaces.IRCode + func (c *Code) DoubleRound(x, to string) interfaces.IRCode + func (c *Code) DoubleSin(x, to string) interfaces.IRCode + func (c *Code) DoubleSqrt(x, to string) interfaces.IRCode + func (c *Code) DoubleSub(x, y, to string) interfaces.IRCode + func (c *Code) DoubleTan(x, to string) interfaces.IRCode + func (c *Code) Exception(message string) interfaces.IRCode + func (c *Code) Exec(mcCommand string) interfaces.IRCode + func (c *Code) Extend(code interfaces.IRCode) interfaces.IRCode + func (c *Code) Func(name string) interfaces.IRCode + func (c *Code) GetInstructions() []interfaces.Instruction + func (c *Code) GetNamespace() string + func (c *Code) GetStorage() string + func (c *Code) If(condVar string, code interfaces.IRCode) interfaces.IRCode + func (c *Code) IntAdd(x, y, to string) interfaces.IRCode + func (c *Code) IntCompare(regRa, regRb string, operator interfaces.TokenType, res string) interfaces.IRCode + func (c *Code) IntDiv(x, y, to string) interfaces.IRCode + func (c *Code) IntMod(x, y, to string) interfaces.IRCode + func (c *Code) IntMul(x, y, to string) interfaces.IRCode + func (c *Code) IntSub(x, y, to string) interfaces.IRCode + func (c *Code) Len() int + func (c *Code) Load(path, score string) interfaces.IRCode + func (c *Code) MakeIndex(valuePath, res string) interfaces.IRCode + func (c *Code) MathOp(operator string) interfaces.IRCode + func (c *Code) PathDelete(obj, path string) interfaces.IRCode + func (c *Code) PathGet(obj, path, to string) interfaces.IRCode + func (c *Code) PathSet(obj, path, valuePath string) interfaces.IRCode + func (c *Code) Raw(mcCommand string) interfaces.IRCode + func (c *Code) Remove(path string) interfaces.IRCode + func (c *Code) RemoveArg(funcName, argName string) interfaces.IRCode + func (c *Code) RemoveVar(name string) interfaces.IRCode + func (c *Code) Ret() interfaces.IRCode + func (c *Code) Score(target string, score *nbt.Int) interfaces.IRCode + func (c *Code) Set(path string, value nbt.Value) interfaces.IRCode + func (c *Code) SetArg(funcName, argName string, value nbt.Value) interfaces.IRCode + func (c *Code) SetArgs(funcName string, value nbt.Compound) interfaces.IRCode + func (c *Code) SetInstructions(instructions []interfaces.Instruction) + func (c *Code) SetVar(name string, value nbt.Value) interfaces.IRCode + func (c *Code) Size(source, res string) interfaces.IRCode + func (c *Code) Store(score, path string) interfaces.IRCode + func (c *Code) StringCompare(a, b, res string) interfaces.IRCode + func (c *Code) StringConcat(a, b, res string) interfaces.IRCode + func (c *Code) StringSlice(stringVar, startIndex, endIndex, res string) interfaces.IRCode + func (c *Code) StructGet(structPath, field, dataPath string) interfaces.IRCode + func (c *Code) StructSet(dataPath, field, structPath string) interfaces.IRCode + func (c *Code) ToMCCode() string + func (c *Code) ToString() string + func (c *Code) Trace(name, path string) interfaces.IRCode + func (c *Code) TraceArg(name, funcName, argName string) interfaces.IRCode + func (c *Code) TraceScore(name, score string) interfaces.IRCode + func (c *Code) TraceVar(name, varName string) interfaces.IRCode + func (c *Code) Unless(condVar string, code interfaces.IRCode) interfaces.IRCode + func (c *Code) XCopy(storageFrom, from, storageTo, to string) interfaces.IRCode + func (c *Code) XLoad(path, score string) interfaces.IRCode + func (c *Code) XRemove(storage, path string) interfaces.IRCode + func (c *Code) XSet(storage, path string, value nbt.Value) interfaces.IRCode + func (c *Code) XTrace(name, storage, path string) interfaces.IRCode + type Function struct + Code interfaces.IRCode + Name string + func (f *Function) GetCode() interfaces.IRCode + func (f *Function) GetName() string + func (f *Function) ToMCFunction() string + func (f *Function) ToString() string + type Instruction struct + Args []string + DPNamespace string + Storage string + Type interfaces.InstructionType + func (i Instruction) GetArgs() []string + func (i Instruction) GetType() interfaces.InstructionType + func (i Instruction) ToMCCommand() string + func (i Instruction) ToString() string + type OptFunc func(instrs []interfaces.Instruction, i int) (matched bool, consumed int, replacement []interfaces.Instruction)