summary refs log tree commit diff
path: root/src/evaluator.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/evaluator.zig')
-rw-r--r--src/evaluator.zig3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/evaluator.zig b/src/evaluator.zig
index ec5df8c..2fc5441 100644
--- a/src/evaluator.zig
+++ b/src/evaluator.zig
@@ -136,7 +136,8 @@ pub const Evaluator = struct {
             .ADDITIVE_EXPRESSION => |x| {
                 const lhs = try self.get_expression_value(x.lhs);
                 const rhs = try self.get_expression_value(x.rhs);
-                return lhs + rhs;
+                if (x.addition) return lhs + rhs;
+                return lhs - rhs;
             },
             .PRIMARY_EXPRESSION => |x| {
                 switch (x) {