feature. See also
. The project being documented here (as the example) is the Zig library itself.
Translator.transCommaExpr
fn transCommaExpr(t: *Translator, scope: *Scope, bin: Node.Binary, used: ResultUsed) TransError!ZigNode
File
Code
fn transCommaExpr(t: *Translator, scope: *Scope, bin: Node.Binary, used: ResultUsed) TransError!ZigNode {
if (used == .unused) {
const lhs = try t.transExprCoercing(scope, bin.lhs, .unused);
try scope.appendNode(lhs);
const rhs = try t.transExprCoercing(scope, bin.rhs, .unused);
return rhs;
}
var block_scope = try Scope.Block.init(t, scope, true);
defer block_scope.deinit();
const lhs = try t.transExprCoercing(&block_scope.base, bin.lhs, .unused);
try block_scope.statements.append(t.gpa, lhs);
const rhs = try t.transExprCoercing(&block_scope.base, bin.rhs, .used);
const break_node = try ZigTag.break_val.create(t.arena, .{
.label = block_scope.label,
.val = try t.toNonBool(rhs, bin.qt),
});
try block_scope.statements.append(t.gpa, break_node);
return try block_scope.complete();
}