Build index when creating a module.

This commit is contained in:
Stephen Chung
2020-11-21 22:18:32 +08:00
parent 254fd16e62
commit e5c9ca23b5
7 changed files with 54 additions and 25 deletions

View File

@@ -50,7 +50,7 @@ impl ModuleResolver for MyModuleResolver {
// Return EvalAltResult::ErrorInModule upon loading error
EvalAltResult::ErrorInModule(path.into(), Box::new(err), pos).into()
)?;
my_module.build_index(); // index it
my_module.build_index(); // index it
Rc::new(my_module) // make it shared
} else {
// Return EvalAltResult::ErrorModuleNotFound if the path is invalid