I have a question: when I compile a script with import into an AST apparently the imported script is not compiled in; consequently, the imported functions are not available... If that expected how do I compile a nested script suite starting from the top?
E.g. the following script:
import "utils" as utils;
fn increment(value) {
print("script: Incrementing... (increment)");
utils::trace("incrementing... (trace)");
value + 1
}
with utils.rhai as:
fn trace(msg) {
print("script: " + msg);
}
produces the following AST:
AST {
source: None,
statements: [
Import(
StringConstant(
"utils",
4:8,
),
Some(
Ident("utils" @ 4:30),
),
4:1,
),
],
functions: Module(
modules:
vars:
functions: increment(value)
),
}
Iow: the imported utils module is not compiled in...?