Encapsulate imported modules into AST.

This commit is contained in:
Stephen Chung
2020-11-09 21:52:23 +08:00
parent 821e64adc4
commit e69444293c
8 changed files with 47 additions and 17 deletions

View File

@@ -29,6 +29,9 @@ Loads a script file (based off the current directory) with `.rhai` extension.
All functions in the _global_ namespace, plus all those defined in the same module,
are _merged_ into a _unified_ namespace.
All modules imported at _global_ level via [`import`] statements become sub-modules,
which are also available to functions defined within the same script file.
Modules are also _cached_ so a script file is only evaluated _once_, even when repeatedly imported.
```rust