From 8847eaa660ef1538050c4bfc51ce405c90e6323b Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Thu, 14 Mar 2024 02:44:37 -0400 Subject: [PATCH] Bugfix for looping --- compile.c | 1 - test/arrays.tm | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/compile.c b/compile.c index 19ff056..0a0c4ea 100644 --- a/compile.c +++ b/compile.c @@ -1146,7 +1146,6 @@ CORD compile(env_t *env, ast_t *ast) } } case IntType: { - env_t *scope = fresh_scope(env); CORD value = compile(env, for_->value); CORD n = compile(env, for_->iter); CORD index = for_->index ? compile(env, for_->index) : CORD_EMPTY; diff --git a/test/arrays.tm b/test/arrays.tm index 376dd6a..78f3d43 100644 --- a/test/arrays.tm +++ b/test/arrays.tm @@ -47,6 +47,9 @@ if yes >> copy = [10, 20] +if yes + >> [10*i for i in 5] + = [10, 20, 30, 40, 50] // if yes // >> arr := @[10, 20] // >> copy := arr[]