Simplified shader test output

This commit is contained in:
2024-09-20 13:00:17 +02:00
parent 3f93e1a92d
commit 243d83663a
11 changed files with 48 additions and 36 deletions

View File

@@ -386,7 +386,11 @@ emit_node :: (state : *Codegen_State, node : *AST_Node, indentation : int) {
}
case .Binary; {
indent(*state.builder, indentation);
append(*state.builder, "(");
if node.token.kind != .TOKEN_ASSIGN {
append(*state.builder, "(");
}
lhs := node.children[0];
rhs := node.children[1];
emit_node(state, lhs, 0);
@@ -395,7 +399,9 @@ emit_node :: (state : *Codegen_State, node : *AST_Node, indentation : int) {
emit_operator(state, node.token.kind);
append(*state.builder, " ");
emit_node(state, rhs, 0);
append(*state.builder, ")");
if node.token.kind != .TOKEN_ASSIGN {
append(*state.builder, ")");
}
}
case .Unary; {
assert(false, "Not implemented yet: unary");