Fix lvalue/rvalue binaries. Fix structured buffer output.
This commit is contained in:
@@ -401,7 +401,7 @@ emit_node :: (state : *Codegen_State, node : *AST_Node, indentation : int) {
|
||||
indent(*state.builder, indentation);
|
||||
|
||||
if node.token.kind != .TOKEN_ASSIGN && node.token.kind != .TOKEN_LEFTBRACKET {
|
||||
if node.parent.kind == .Binary && node.parent.token.kind != .TOKEN_ASSIGN {
|
||||
if (node.parent.kind == .Binary && node.parent.token.kind != .TOKEN_ASSIGN) || node.parent.kind == .Access {
|
||||
append(*state.builder, "(");
|
||||
}
|
||||
}
|
||||
@@ -422,10 +422,8 @@ emit_node :: (state : *Codegen_State, node : *AST_Node, indentation : int) {
|
||||
emit_node(state, rhs, 0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
if node.token.kind != .TOKEN_ASSIGN && node.token.kind != .TOKEN_LEFTBRACKET {
|
||||
if node.parent.kind == .Binary && node.parent.token.kind != .TOKEN_ASSIGN {
|
||||
if (node.parent.kind == .Binary && node.parent.token.kind != .TOKEN_ASSIGN) || node.parent.kind == .Access {
|
||||
append(*state.builder, ")");
|
||||
}
|
||||
}
|
||||
@@ -577,10 +575,8 @@ emit_buffer :: (state : *Codegen_State, node : *AST_Node, indentation : int) {
|
||||
element := from_handle(state.ctx.type_variables, variable.element_type);
|
||||
|
||||
emit_struct(state, node, indentation, element.typename);
|
||||
// print_to_builder(*state.builder, "struct %\n", element.name);
|
||||
|
||||
print_to_builder(*state.builder, "StructuredBuffer<%> % : register(t%);\n\n", element.typename, variable.name, variable.resource_index);
|
||||
|
||||
}
|
||||
|
||||
emit_declaration :: (state : *Codegen_State, node : *AST_Node) {
|
||||
|
||||
Reference in New Issue
Block a user