feat(defs): nested modules, single file

This commit is contained in:
tamasfe
2022-07-27 23:39:03 +02:00
parent b6ddd276f0
commit 9fac93d404
5 changed files with 6421 additions and 38 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -32,10 +32,17 @@ fn main() -> Result<(), Box<EvalAltResult>> {
"hello_there = general_kenobi::hello_there(4 minus 2);",
)?;
// Generate definitions for the contents of the engine and the scope.
engine
.definitions_with_scope(&scope)
.write_to_dir("examples/definitions/.rhai/definitions")
.unwrap();
// Alternatively we can write all of the above to a single file.
engine
.definitions_with_scope(&scope)
.write_to_file("examples/definitions/.rhai/all_in_one.d.rhai")
.unwrap();
Ok(())
}