summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJari Vetoniemi <mailroxas@gmail.com>2018-09-28 14:11:01 +0300
committerJari Vetoniemi <mailroxas@gmail.com>2018-09-28 14:11:01 +0300
commit56a17f4d966b2d53cd19a8ccc5ea237cd4cb13c2 (patch)
tree22db5202255566918a3552eeb3e973c6966310e5
parent320a0c41fe6420b361f44b311d1fd42ec97e7d46 (diff)
expr: add missing modulo operation
-rw-r--r--src/compiler/expr.lm1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/compiler/expr.lm b/src/compiler/expr.lm
index c5548cc..b17cc39 100644
--- a/src/compiler/expr.lm
+++ b/src/compiler/expr.lm
@@ -167,6 +167,7 @@ context collapser
| [number::type WS `~] { lhs.value = parse value[$bitnot(r1.value)] }
| [number::type WS number::type WS `*] { lhs.value = parse value[$(r1.value * r3.value)] }
| [number::type WS number::type WS `/] { lhs.value = parse value[$(r1.value / r3.value)] }
+ | [number::type WS number::type WS `%] { lhs.value = parse value[$modulo(r1.value, r3.value)] }
| [number::type WS number::type WS `#+] { lhs.value = parse value[$(r1.value + r3.value)] }
| [number::type WS number::type WS `#-] { lhs.value = parse value[$(r1.value - r3.value)] }
| [number::type WS number::type WS `<<] { lhs.value = parse value[$shiftl(r1.value, r3.value)] }