Add functions to iterate script function definitions.

This commit is contained in:
Stephen Chung
2020-09-24 16:10:25 +08:00
parent 12e9a8567d
commit b8aeaa84de
3 changed files with 28 additions and 14 deletions

View File

@@ -299,6 +299,12 @@ impl AST {
self.1.retain_functions(filter);
}
/// Iterate through all functions
#[cfg(not(feature = "no_function"))]
pub fn iter_functions(&self, action: impl Fn(FnAccess, &str, usize)) {
self.1.iter_script_fn_info(action);
}
/// Clear all function definitions in the `AST`.
#[cfg(not(feature = "no_function"))]
pub fn clear_functions(&mut self) {