Skip to content

Commit

Permalink
Update interpreter.go
Browse files Browse the repository at this point in the history
  • Loading branch information
bobimicroweber committed Aug 20, 2024
1 parent 94ac0c6 commit f895acd
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion interpreter/interpreter.go
Original file line number Diff line number Diff line change
Expand Up @@ -463,8 +463,13 @@ func (interp *interpreter) evaluate(expr parser.Expression) Value {
panic(fmt.Sprintf("Method '%s' not found in class '%s'", methodName, instance.Name))
}

args := []Value{}
for _, a := range e.Arguments {
args = append(args, interp.evaluate(a))
}

//print("CallMethod name -> ", method.name())
return method.call(interp, e.Position(), nil)
return method.call(interp, e.Position(), args)

case *parser.NewExpression:
// Evaluate the class name and arguments
Expand Down

0 comments on commit f895acd

Please sign in to comment.