Add hint parsing on constant buffers. Not yet used in output.
This commit is contained in:
13
Parsing.jai
13
Parsing.jai
@@ -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);
|
||||
|
||||
|
||||
@@ -119,6 +119,8 @@ Constant_Buffer :: struct {
|
||||
|
||||
fields : Static_Array(Property_Field, 16);
|
||||
|
||||
hint : Field_Hint; // optional hint...
|
||||
|
||||
buffer_index : u32;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user