From 355831dc293698c816bdf22c3ed1b1f3dc53ceae Mon Sep 17 00:00:00 2001 From: alpha Date: Mon, 15 Aug 2022 23:22:11 +0000 Subject: [PATCH] 10.1.2 FossilOrigin-Name: fae7fe1a493cd7d2c31e140204cfd581080c6bf5a70ed967107a1a5237bed129 --- ruby/lib/lox/interpreter.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ruby/lib/lox/interpreter.rb b/ruby/lib/lox/interpreter.rb index 90f087d..703389e 100644 --- a/ruby/lib/lox/interpreter.rb +++ b/ruby/lib/lox/interpreter.rb @@ -138,7 +138,13 @@ module Lox left * right else fail end + end + + def visit_call(expr) + callee = evaluate(expr.callee) + args = expr.args.map { evaluate(_1) } + callee.call(self, args) end private