diff options
author | Leo Tenenbaum <pommicket@gmail.com> | 2019-11-06 10:39:34 -0500 |
---|---|---|
committer | Leo Tenenbaum <pommicket@gmail.com> | 2019-11-06 10:39:34 -0500 |
commit | 532287ffe97392c5b2b9f24646c5ec99095acd93 (patch) | |
tree | 9e90bcd087da3b323b1e9d5f7806051a3320c220 | |
parent | 8ef3f12777d9461746cf6b718223194e13901c8d (diff) |
compile time each!
-rw-r--r-- | eval.c | 7 | ||||
-rw-r--r-- | main.c | 1 |
2 files changed, 4 insertions, 4 deletions
@@ -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; @@ -1,6 +1,5 @@ /* TODO: -compile-time each allow just each arr { ... } each pointer compile-time each pointer |