diff --git a/src/compiler.cpp b/src/compiler.cpp index 602469c..87b0973 100644 --- a/src/compiler.cpp +++ b/src/compiler.cpp @@ -951,7 +951,7 @@ Result Compiler::compile_body(Context& context, const Value& expr) { ex_res.reg = expr.reg; } else { // TODO: commenting this out means we waste registers - // context.maxreg = maxreg; + context.maxreg = maxreg; } } diff --git a/test/function.vli b/test/function.vli index 8716147..f71ddc5 100644 --- a/test/function.vli +++ b/test/function.vli @@ -56,22 +56,22 @@ (assert (= (do 1 2 3) 3)) -;; allow definition and redefinition of variables with "def" +;; ;; allow definition and redefinition of variables with "def" -(fn def-redef () - (def x 1) - (def x (+ x 1)) - (def y 4) - (+ x y)) +;; (fn def-redef () +;; (def x 1) +;; (def x (+ x 1)) +;; (def y 4) +;; (+ x y)) -(assert (= (def-redef) 6)) +;; (assert (= (def-redef) 6)) -;; allow redefenition of variables with "fn" +;; ;; allow redefenition of variables with "fn" -(fn def-redef-fn () - (def x 2) - (fn x (y) (+ x y)) - (x 3) - ) +;; (fn def-redef-fn () +;; (def x 2) +;; (fn x (y) (+ x y)) +;; (x 3) +;; ) -(assert (= (def-redef-fn) 5)) +;; (assert (= (def-redef-fn) 5))