summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2019-11-06 10:39:34 -0500
committerLeo Tenenbaum <pommicket@gmail.com>2019-11-06 10:39:34 -0500
commit532287ffe97392c5b2b9f24646c5ec99095acd93 (patch)
tree9e90bcd087da3b323b1e9d5f7806051a3320c220
parent8ef3f12777d9461746cf6b718223194e13901c8d (diff)
compile time each!
-rw-r--r--eval.c7
-rw-r--r--main.c1
2 files changed, 4 insertions, 4 deletions
diff --git a/eval.c b/eval.c
index 0933aec..3c44470 100644
--- a/eval.c
+++ b/eval.c
@@ -1218,19 +1218,20 @@ static bool eval_expr(Evaluator *ev, Expression *e, Value *v) {
boolt.flags = TYPE_FLAG_RESOLVED;
boolt.kind = TYPE_BUILTIN;
boolt.builtin = BUILTIN_BOOL;
- eval_numerical_bin_op(lhs, &ea->type, step_is_negative ? BINARY_GE : BINARY_LE, rhs, &ea->range.to->type, v, &boolt);
+ Value cont;
+ eval_numerical_bin_op(lhs, &ea->type, step_is_negative ? BINARY_GE : BINARY_LE, rhs, &ea->range.to->type, &cont, &boolt);
- if (!v->boolv) break;
+ if (!cont.boolv) break;
}
if (value_val) *value_val = x;
if (!eval_block(ev, &ea->body, &e->type, v)) return false;
-
if (index_val) {
index_val->i64++;
}
eval_numerical_bin_op(x, &ea->type, BINARY_ADD, stepval, ea->range.stepval ? &ea->type : &i64t, &x, &ea->type);
}
+
} else {
Value of;
if (!eval_expr(ev, ea->of, &of)) return false;
diff --git a/main.c b/main.c
index 9f487e0..7250218 100644
--- a/main.c
+++ b/main.c
@@ -1,6 +1,5 @@
/*
TODO:
-compile-time each
allow just each arr { ... }
each pointer
compile-time each pointer