Struct output shenanigans
This commit is contained in:
@@ -393,6 +393,9 @@ advance :: (parse_state : *Parse_State) {
|
|||||||
parse_state.previous = parse_state.current;
|
parse_state.previous = parse_state.current;
|
||||||
|
|
||||||
while true {
|
while true {
|
||||||
|
if parse_state.current_token_index >= parse_state.tokens.count {
|
||||||
|
break;
|
||||||
|
}
|
||||||
parse_state.current = *parse_state.tokens[parse_state.current_token_index];
|
parse_state.current = *parse_state.tokens[parse_state.current_token_index];
|
||||||
parse_state.current_token_index += 1;
|
parse_state.current_token_index += 1;
|
||||||
if parse_state.current.kind != .TOKEN_ERROR break;
|
if parse_state.current.kind != .TOKEN_ERROR break;
|
||||||
@@ -799,6 +802,10 @@ argument_list :: (parse_state : *Parse_State) -> *AST_Node {
|
|||||||
|
|
||||||
if check(parse_state, .TOKEN_RIGHTPAREN) break;
|
if check(parse_state, .TOKEN_RIGHTPAREN) break;
|
||||||
consume(parse_state, .TOKEN_COMMA, "Expect ',' after function argument.");
|
consume(parse_state, .TOKEN_COMMA, "Expect ',' after function argument.");
|
||||||
|
|
||||||
|
if parse_state.result.had_error {
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
consume(parse_state, .TOKEN_RIGHTPAREN, "Expect ')' after function call.");
|
consume(parse_state, .TOKEN_RIGHTPAREN, "Expect ')' after function call.");
|
||||||
|
|||||||
@@ -372,6 +372,7 @@ type_variable_to_field :: (type_variables : []Type_Variable, scope_stack : Scope
|
|||||||
field_hint.kind = .Target;
|
field_hint.kind = .Target;
|
||||||
} else {
|
} else {
|
||||||
field_hint.custom_hint_name = copy_string(hint.ident_value);
|
field_hint.custom_hint_name = copy_string(hint.ident_value);
|
||||||
|
field_hint.kind = .Custom;
|
||||||
}
|
}
|
||||||
array_add(*field.hints, field_hint);
|
array_add(*field.hints, field_hint);
|
||||||
}
|
}
|
||||||
|
|||||||
15
test/struct_output_vertex.ink
Normal file
15
test/struct_output_vertex.ink
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
VS_Out :: struct {
|
||||||
|
pos : float4 @outposition;
|
||||||
|
}
|
||||||
|
|
||||||
|
vertex main :: (pos : float3 @position) -> VS_Out {
|
||||||
|
vs_out : VS_Out;
|
||||||
|
|
||||||
|
vs_out.pos = float4(pos, 1.0);
|
||||||
|
|
||||||
|
return vs_out;
|
||||||
|
}
|
||||||
|
|
||||||
|
pixel main :: (ps_in : VS_Out) -> float4 @target {
|
||||||
|
return float4(1, 1, 1, 1);
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user