diff --git a/src/ast.rs b/src/ast.rs index 3fede85..04a884d 100644 --- a/src/ast.rs +++ b/src/ast.rs @@ -69,7 +69,7 @@ pub enum StmtKind { code: Vec, }, Call { - iden: Iden, + expr: Expr, args: Vec, }, Print(Expr), diff --git a/src/interpret.rs b/src/interpret.rs index bf3e49e..1f0f0f6 100644 --- a/src/interpret.rs +++ b/src/interpret.rs @@ -267,8 +267,8 @@ impl ExecEnv { return self.eval_stmts_hs(&body.block, true); } } - StmtKind::Call { iden, args } => { - let func = self.get_var(iden)?; + StmtKind::Call { expr, args } => { + let func = self.eval_expr(expr)?; if let Value::Functio(func) = func { self.fn_call(func, args, &stmt.span)?;