From cc39e559ae8814b7c7e0e117fbb1b3bdf389ef6f Mon Sep 17 00:00:00 2001 From: Stephen Chung Date: Fri, 6 Mar 2020 15:49:38 +0800 Subject: [PATCH] Change debug print info for function registration. --- src/api.rs | 12 ++++++------ src/engine.rs | 7 ++++++- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/api.rs b/src/api.rs index 49553624..b27378f2 100644 --- a/src/api.rs +++ b/src/api.rs @@ -17,13 +17,13 @@ impl<'a> Engine<'a> { f: Box, ) { 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::>() - .join(", ") + if let Some(a) = &args { + format!("{}", a.len()) + } else { + "no".to_string() + } ); let spec = FnSpec { diff --git a/src/engine.rs b/src/engine.rs index 48b57199..b00db1f9 100644 --- a/src/engine.rs +++ b/src/engine.rs @@ -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())), } }