From 49a8a1c24ba49c1bda0d35c5686621c48841db3f Mon Sep 17 00:00:00 2001 From: Will Anderson Date: Sun, 3 May 2026 15:44:19 -0500 Subject: [PATCH] add % modulo operator to El lexer, parser, codegen Lexer and parser already had Percent token and precedence on the compiler/string-interp branch. This commit adds the missing is_int_expr case for Percent so that modulo expressions over Int operands are correctly typed as Int (enabling arithmetic dispatch rather than falling through to string concat or untyped paths). binop_to_c already mapped Percent -> % at HEAD; only is_int_expr needed the Percent arm. --- el-compiler/src/codegen.el | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/el-compiler/src/codegen.el b/el-compiler/src/codegen.el index c2aec70..7a94911 100644 --- a/el-compiler/src/codegen.el +++ b/el-compiler/src/codegen.el @@ -1771,6 +1771,12 @@ fn is_int_expr(expr: Map) -> Bool { } return false } + if str_eq(op, "Percent") { + if is_int_expr(expr["left"]) { + if is_int_expr(expr["right"]) { return true } + } + return false + } return false } return false