aboutsummaryrefslogtreecommitdiff
path: root/src/parse.zig
diff options
context:
space:
mode:
authorMathias Magnusson <mathias@magnusson.space>2025-07-30 16:26:48 +0200
committerMathias Magnusson <mathias@magnusson.space>2025-07-30 16:26:48 +0200
commit132a8da9a41a6303d40c8ec936a31c9481581cbe (patch)
tree89d57f62a100467e5257f36078a07b1adfbf9bbc /src/parse.zig
parent222ec8886d246b7e1a54157fd974aa5291e1d464 (diff)
downloadhuginn-132a8da9a41a6303d40c8ec936a31c9481581cbe.tar.gz
implement `==`
Diffstat (limited to 'src/parse.zig')
-rw-r--r--src/parse.zig3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/parse.zig b/src/parse.zig
index e22397f..3ecb93b 100644
--- a/src/parse.zig
+++ b/src/parse.zig
@@ -122,6 +122,7 @@ pub const Expr = struct {
right_angle,
left_angle_equal,
right_angle_equal,
+ equal_equal,
pub fn format(self: Op, comptime _: []const u8, _: std.fmt.FormatOptions, writer: anytype) !void {
try writer.writeAll(switch (self) {
@@ -131,6 +132,7 @@ pub const Expr = struct {
.right_angle => ">",
.left_angle_equal => "<=",
.right_angle_equal => ">=",
+ .equal_equal => "==",
});
}
};
@@ -298,6 +300,7 @@ fn parseComparisons(allocator: Allocator, lexer: *Lexer) ParseError!*Expr {
.right_angle => .right_angle,
.left_angle_equal => .left_angle_equal,
.right_angle_equal => .right_angle_equal,
+ .equal_equal => .equal_equal,
else => return lhs,
};
_ = lexer.next();