API reference / @jsprismarine/molang / Molang
Class: Molang
Defined in: Molang.ts:29
Compiles Molang expressions to closures, once per (source text, version), and caches the result. Source that fails to parse compiles to a constant 0 with a syntax-error diagnostic, matching the engine's content-error behavior.
Constructors
Constructor
new Molang(
options?):Molang
Defined in: Molang.ts:35
Parameters
options?
MolangOptions = {}
Returns
Molang
Properties
queries
readonlyqueries:QueryRegistry
Defined in: Molang.ts:31
The registry this engine binds query.* names against.
Methods
compile()
compile(
source,options?):CompiledMolang
Defined in: Molang.ts:40
Compiles an expression, reusing the cached result for the same (source, version) pair.
Parameters
source
string
options?
CompileOptions = {}