about summary refs log tree commit diff
path: root/boot/parse.c
diff options
context:
space:
mode:
authorMel <mel@rnrd.eu>2026-05-24 20:01:38 +0200
committerMel <mel@rnrd.eu>2026-05-24 20:01:38 +0200
commitf028bc7ef3101facfa004c21f3aa5feb3dc6f107 (patch)
tree3458a0ec69c9552354cb7d3dde38d8f6edd0ad14 /boot/parse.c
parent99d57398863ab1734a9f81c2d336f82dab556383 (diff)
downloadcatskill-f028bc7ef3101facfa004c21f3aa5feb3dc6f107.tar.zst
catskill-f028bc7ef3101facfa004c21f3aa5feb3dc6f107.zip
Support named-unnamed call and construction arguments and fields with final resolved order
Signed-off-by: Mel <mel@rnrd.eu>
Diffstat (limited to 'boot/parse.c')
-rw-r--r--boot/parse.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/boot/parse.c b/boot/parse.c
index 2b5d859..1cf08fd 100644
--- a/boot/parse.c
+++ b/boot/parse.c
@@ -407,6 +407,7 @@ parser_function_header_node(struct Parser* p, struct Parser_Error* error)
         CHECK_RETURN(parser_need(p, TOKEN_ROUND_OPEN, error), struct Tree_Function_Header);
 
     struct Tree_Function_Header header = { 0 };
+    struct Tree_Type* tail = nil;
     while (!parser_probe(p, TOKEN_ROUND_CLOSE)) {
         // TODO: correctly output parameter spans
         bool variadic = false;
@@ -432,7 +433,8 @@ parser_function_header_node(struct Parser* p, struct Parser_Error* error)
         if (!header.parameters_type_and_name)
             header.parameters_type_and_name = type;
         else
-            header.parameters_type_and_name->next = type;
+            tail->next = type;
+        tail = type;
 
         if (parser_probe(p, TOKEN_COMMA)) parser_next(p);
     }