Add gen_fn_siguatures API.
This commit is contained in:
@@ -42,6 +42,7 @@ fn print_help() {
|
||||
println!("help => print this help");
|
||||
println!("quit, exit => quit");
|
||||
println!("scope => print all variables in the scope");
|
||||
println!("functions => print all functions defined");
|
||||
println!("ast => print the last AST");
|
||||
println!("astu => print the last raw, un-optimized AST");
|
||||
println!(r"end a line with '\' to continue to the next line.");
|
||||
@@ -133,6 +134,18 @@ fn main() {
|
||||
println!("{:#?}\n", &ast);
|
||||
continue;
|
||||
}
|
||||
"functions" => {
|
||||
// print a list of all registered functions
|
||||
engine
|
||||
.gen_fn_signatures(false)
|
||||
.into_iter()
|
||||
.for_each(|f| println!("{}", f));
|
||||
main_ast
|
||||
.iter_functions()
|
||||
.for_each(|(_, _, _, _, f)| println!("{}", f));
|
||||
println!();
|
||||
continue;
|
||||
}
|
||||
_ => (),
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user