summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorBaitinq <manuelpalenzuelamerino@gmail.com>2025-01-12 16:48:43 +0100
committerBaitinq <manuelpalenzuelamerino@gmail.com>2025-01-12 16:48:43 +0100
commitaaaf72b3f4eddfe82262caf5e07a2f029c068143 (patch)
tree67fc9ea8ad6c53b59333d873b597a2a2b8ba4aae /src
parentTokenizer: Fix tokenizer invalid strings (diff)
downloadinterpreter-aaaf72b3f4eddfe82262caf5e07a2f029c068143.tar.gz
interpreter-aaaf72b3f4eddfe82262caf5e07a2f029c068143.tar.bz2
interpreter-aaaf72b3f4eddfe82262caf5e07a2f029c068143.zip
Evaluator: Fix bug when variables are initialized with the same identifier as the defined
Diffstat (limited to 'src')
-rw-r--r--src/evaluator.zig3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/evaluator.zig b/src/evaluator.zig
index e8e1bc5..f8bb052 100644
--- a/src/evaluator.zig
+++ b/src/evaluator.zig
@@ -90,7 +90,8 @@ pub const Evaluator = struct {
                     std.debug.print("Identifier {any} not found\n", .{identifier.name});
                     return EvaluatorError.EvaluationError;
                 };
-                return try self.get_expression_value(expression.?);
+
+                return try self.get_expression_value(expression orelse return EvaluatorError.EvaluationError);
             },
         };
     }