Change debug print info for function registration.

This commit is contained in:
Stephen Chung 2020-03-06 15:49:38 +08:00
parent 42fe5e8b95
commit cc39e559ae
2 changed files with 12 additions and 7 deletions

View File

@ -17,13 +17,13 @@ impl<'a> Engine<'a> {
f: Box<FnAny>,
) {
debug_println!(
"Register function: {} ({})",
"Register function: {} for {} parameter(s)",
fn_name,
args.iter()
.map(|x| (*x).type_name())
.map(|name| self.map_type_name(name))
.collect::<Vec<_>>()
.join(", ")
if let Some(a) = &args {
format!("{}", a.len())
} else {
"no".to_string()
}
);
let spec = FnSpec {

View File

@ -430,8 +430,13 @@ impl Engine<'_> {
value
}
// {expr}.???
expr => {
let mut target = self.eval_expr(scope, expr)?;
self.get_dot_val_helper(scope, target.as_mut(), dot_rhs)
}
// Syntax error
_ => Err(EvalAltResult::ErrorDotExpr(dot_lhs.position())),
//_ => Err(EvalAltResult::ErrorDotExpr(dot_lhs.position())),
}
}