aboutsummaryrefslogtreecommitdiff
path: root/src/compile
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2025-12-31 15:13:32 -0500
committerBruce Hill <bruce@bruce-hill.com>2025-12-31 15:13:32 -0500
commitdbae987f1fb54da795185a03f4c00d56a639f8cd (patch)
tree40a4d00c045c29cd9af117aa01194b8c8be4fbeb /src/compile
parent0f9af5f44bd2735f34a48ceb177837a5a6ef25b0 (diff)
Changed is_between() to be bidirectional
Diffstat (limited to 'src/compile')
-rw-r--r--src/compile/comparisons.c1
-rw-r--r--src/compile/functions.c1
2 files changed, 2 insertions, 0 deletions
diff --git a/src/compile/comparisons.c b/src/compile/comparisons.c
index 62196cdf..c2d376ef 100644
--- a/src/compile/comparisons.c
+++ b/src/compile/comparisons.c
@@ -41,6 +41,7 @@ Text_t compile_comparison(env_t *env, ast_t *ast) {
} else {
code_err(ast, "I can't do comparisons between ", type_to_text(lhs_t), " and ", type_to_text(rhs_t));
}
+ assert(operand_t);
Text_t lhs, rhs;
lhs = compile_to_type(env, binop.lhs, operand_t);
diff --git a/src/compile/functions.c b/src/compile/functions.c
index 01377a89..f62e00f8 100644
--- a/src/compile/functions.c
+++ b/src/compile/functions.c
@@ -633,6 +633,7 @@ static void check_unused_vars(env_t *env, arg_ast_t *args, ast_t *body) {
// Global/file scoped vars are okay to mutate without reading
if (get_binding(env, entry->name) != NULL) continue;
ast_t *var = Table$str_get(assigned_vars, entry->name);
+ assert(var);
code_err(var, "This variable was assigned to, but never read from.");
}
}