Interpreter.evaluate

This is the main entry point for evaluating a script program. If the useVM option was set in the constructor, bytecode compilation and execution will be used, otherwise tree walking.

class Interpreter
ScriptAny
evaluate
(
in string code
,
bool printDisasm = false
,
bool fromScript = false
)

Parameters

code string

This is the source code of a script to be executed.

printDisasm bool

If VM mode is set, print the disassembly of bytecode before running if true.

fromScript bool

This parameter is reserved for internal use and should be left as false

Return Value

Type: ScriptAny

If the script has a return statement with an expression, this value will be the result of that expression otherwise it will be ScriptAny.UNDEFINED

Meta