Fix indexing issue breaking function declarations.

This commit is contained in:
2024-06-22 09:44:15 +02:00
parent 98f979a368
commit d5fdaca1ca

View File

@@ -21,8 +21,8 @@ Semantic_Type :: enum {
Half :: 1; Half :: 1;
Float :: 2; Float :: 2;
Double :: 3; Double :: 3;
Texture2D :: 8; Texture2D :: 4;
Sampler :: 9; Sampler :: 5;
Max_Builtin :: Sampler + 1; Max_Builtin :: Sampler + 1;
@@ -49,8 +49,8 @@ Typenames :: string.[
"half" , "half" ,
"float" , "float" ,
"double" , "double" ,
"sampler" ,
"texture2D", "texture2D",
"sampler" ,
]; ];
Type_Variable :: struct { Type_Variable :: struct {
@@ -1015,7 +1015,7 @@ declare_function :: (checker : *Semantic_Checker, node : *AST_Node, builtin : bo
all_same : bool = true; all_same : bool = true;
for i : 0..func_var.child_count - 1 { for i : 0..func_var.child_count - 1 {
arg := func_var.children[i]; arg := func_var.children[i];
node_child := field_list.children[it_index]; node_child := field_list.children[i];
typename : string; typename : string;
arg_type := get_type_from_identifier(checker, checker.current_scope, node_child, *typename); arg_type := get_type_from_identifier(checker, checker.current_scope, node_child, *typename);