Refactor to do more pre-calculation work.

This commit is contained in:
Stephen Chung
2023-02-12 21:50:32 +08:00
parent 9f18d6519d
commit d0a47d7f66
11 changed files with 65 additions and 36 deletions

View File

@@ -287,7 +287,8 @@ fn collect_fn_metadata(
#[cfg(not(feature = "no_module"))]
{
use crate::{tokenizer::Token::DoubleColon, Shared, SmartString};
use crate::engine::NAMESPACE_SEPARATOR;
use crate::{Shared, SmartString};
// Recursively scan modules for script-defined functions.
fn scan_module(
@@ -305,7 +306,7 @@ fn collect_fn_metadata(
use std::fmt::Write;
let mut ns = SmartString::new_const();
write!(&mut ns, "{namespace}{}{name}", DoubleColon.literal_syntax()).unwrap();
write!(&mut ns, "{namespace}{}{name}", NAMESPACE_SEPARATOR).unwrap();
scan_module(engine, list, &ns, m, filter);
}
}