Skip to content

RuleScript

Kriptel edited this page Dec 5, 2024 · 2 revisions

func new

function new(?interp:RuleScriptInterp, ?parser:Parser)

script = new RuleScript(new RuleScriptInterp(), new HxParser());
  • interp - interpreter to be used in the script. The default value is an instance of the RuleScriptInterp class.

  • parser - parser to be used, when calling the execute/tryExecute function with a string as the first argument. Parsers from RuleParsers can also be used as an argument

func execute

function execute(code:StringOrExpr):Dynamic

  • code - сan be a string or hscript.Expr.

var superInstance

var superInstance:Dynamic

source

script.superInstance = obj; // obj with `x(default,set):float` field.

script

x = 100; // The x field of obj will be changed to 100,

Clone this wiki locally