Add hint parsing on constant buffers. Not yet used in output.

This commit is contained in:
2025-08-25 22:08:58 +02:00
parent ab711b5610
commit e0908a67c0
2 changed files with 14 additions and 1 deletions

View File

@@ -771,7 +771,6 @@ field_declaration :: (parse_state : *Parse_State, identifier_token : *Token) ->
advance(parse_state);
}
}
} else if match(parse_state, .TOKEN_ASSIGN) {
add_child(node, expression(parse_state));
}
@@ -1108,6 +1107,18 @@ constant_buffer :: (parse_state : *Parse_State, identifier_token : *Token = null
node : *AST_Node;
source_location : Source_Range;
source_location.begin = parse_state.current;
if check(parse_state, .TOKEN_AT) {
while check(parse_state, .TOKEN_AT) {
advance(parse_state);
// @Incomplete(niels): this is a mapping
if check(parse_state, .TOKEN_IDENTIFIER) {
array_add(*node.hint_tokens, parse_state.current);
advance(parse_state);
}
}
}
consume(parse_state, .TOKEN_LEFTBRACE, "Expect '{' after 'constant_buffer' keyword");
buffer := field_list(parse_state, .Semicolon);

View File

@@ -119,6 +119,8 @@ Constant_Buffer :: struct {
fields : Static_Array(Property_Field, 16);
hint : Field_Hint; // optional hint...
buffer_index : u32;
}