Implement Control Flow Statements in Kym #37

Merged
kayomn merged 8 commits from kym-control-flow into main 2023-08-26 00:01:25 +02:00
1 changed files with 4 additions and 1 deletions
Showing only changes of commit 56d9899ac2 - Show all commits

View File

@ -42,10 +42,13 @@ pub const BinaryOperator = enum {
"`"); "`");
} }
// TODO: Remove once Zig has fixed struct self-reassignment.
const unnecessary_temp = try coral.io.allocate_one(allocator, expression);
expression = .{ expression = .{
.binary_operation = .{ .binary_operation = .{
.operator = operator, .operator = operator,
.lhs_expression = try coral.io.allocate_one(allocator, expression), .lhs_expression = unnecessary_temp,
.rhs_expression = try coral.io.allocate_one(allocator, try build_next(self)), .rhs_expression = try coral.io.allocate_one(allocator, try build_next(self)),
}, },
}; };