Skip to content

Commit

Permalink
typo fix
Browse files Browse the repository at this point in the history
  • Loading branch information
vaibhavsijaria committed Oct 3, 2024
1 parent 84b4b1c commit f359d33
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/error.zig
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ pub const ParseError = error{
pub const RuntimeError = error{
IncompatibleTypes,
InvalidOperation,
NullType,
};

pub const Error = struct {
Expand Down
6 changes: 3 additions & 3 deletions src/interpreter.zig
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,11 @@ pub const Interpreter = struct {
fn binary(self: *Interpreter, expr: Exprs.Binary) anyerror!?obj {
const left = self.interpret(expr.left) orelse {
Error.printerr(expr.operator, "Error while interpreting left operand");
return null;
return RuntimeErrors.NullType;
};
const right = self.interpret(expr.right) orelse {
Error.printerr(expr.operator, "Error while interpreting left operand");
return null;
Error.printerr(expr.operator, "Error while interpreting right operand");
return RuntimeErrors.NullType;
};

if (@intFromEnum(left) != @intFromEnum(right)) {
Expand Down

0 comments on commit f359d33

Please sign in to comment.