Split AST into separate files.

This commit is contained in:
Stephen Chung
2021-12-17 16:07:13 +08:00
parent b1b2c62d7d
commit c7ec27acc7
16 changed files with 2693 additions and 2614 deletions

View File

@@ -561,7 +561,7 @@ impl Engine {
_ => (),
}
// Scripted function call?
// Script-defined function call?
#[cfg(not(feature = "no_function"))]
if let Some(FnResolutionCacheEntry { func, source }) = self
.resolve_fn(mods, state, lib, fn_name, hashes.script, None, false, false)
@@ -570,7 +570,7 @@ impl Engine {
// Script function call
assert!(func.is_script());
let func = func.get_script_fn_def().expect("scripted function");
let func = func.get_script_fn_def().expect("script-defined function");
if func.body.is_empty() {
return Ok((Dynamic::UNIT, false));
@@ -1271,7 +1271,7 @@ impl Engine {
match func {
#[cfg(not(feature = "no_function"))]
Some(f) if f.is_script() => {
let fn_def = f.get_script_fn_def().expect("scripted function");
let fn_def = f.get_script_fn_def().expect("script-defined function");
if fn_def.body.is_empty() {
Ok(Dynamic::UNIT)

View File

@@ -476,7 +476,7 @@ impl CallableFunction {
Self::Script(_) => false,
}
}
/// Is this a Rhai-scripted function?
/// Is this a script-defined function?
#[inline]
#[must_use]
pub const fn is_script(&self) -> bool {

View File

@@ -163,7 +163,7 @@ impl Engine {
result
}
// Does a scripted function exist?
// Does a script-defined function exist?
#[must_use]
pub(crate) fn has_script_fn(
&self,