diff options
| author | Baitinq <[email protected]> | 2025-01-12 16:48:43 +0100 |
|---|---|---|
| committer | Baitinq <[email protected]> | 2025-01-12 16:48:43 +0100 |
| commit | 0ecd86e541ae5e36e51dcf44fe7b305d0f8741aa (patch) | |
| tree | 67fc9ea8ad6c53b59333d873b597a2a2b8ba4aae | |
| parent | Tokenizer: Fix tokenizer invalid strings (diff) | |
| download | pry-lang-0ecd86e541ae5e36e51dcf44fe7b305d0f8741aa.tar.gz pry-lang-0ecd86e541ae5e36e51dcf44fe7b305d0f8741aa.tar.bz2 pry-lang-0ecd86e541ae5e36e51dcf44fe7b305d0f8741aa.zip | |
Evaluator: Fix bug when variables are initialized with the same identifier as the defined
| -rw-r--r-- | src/evaluator.zig | 3 | ||||
| -rw-r--r-- | todo/3.src | 1 |
2 files changed, 2 insertions, 2 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); }, }; } diff --git a/todo/3.src b/todo/3.src deleted file mode 100644 index 29ade8c..0000000 --- a/todo/3.src +++ /dev/null @@ -1 +0,0 @@ -let x = x; |