diff options
| author | Mel <mel@rnrd.eu> | 2025-12-28 23:54:51 +0100 |
|---|---|---|
| committer | Mel <mel@rnrd.eu> | 2025-12-28 23:54:51 +0100 |
| commit | 57878200dda049cf7d6f11c9ede6936d184649cb (patch) | |
| tree | 2fb5514036b763ba8400e2d98c6f12e20c8da24f /boot/parse.c | |
| parent | 0e08695d031ebb2e00a13582a75e1f27c2d6c73a (diff) | |
| download | catskill-57878200dda049cf7d6f11c9ede6936d184649cb.tar.zst catskill-57878200dda049cf7d6f11c9ede6936d184649cb.zip | |
Expand bootstrap common library with generic Array and more String utility functions
Signed-off-by: Mel <mel@rnrd.eu>
Diffstat (limited to 'boot/parse.c')
| -rw-r--r-- | boot/parse.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/boot/parse.c b/boot/parse.c index 481fa90..ea6b06b 100644 --- a/boot/parse.c +++ b/boot/parse.c @@ -499,7 +499,7 @@ parser_function_header_node(struct Parser* p, struct Parser_Error* error) struct Argument_Group_Node parser_argument_group_node(struct Parser* p, struct Parser_Error* error) { - struct String_Array argument_names = string_array_new(); + Array(struct String) argument_names = array_new(struct String, 32); struct Expression *arguments_head = nil, *arguments_current = nil; for (;;) { // check if we have a named argument. @@ -521,7 +521,7 @@ parser_argument_group_node(struct Parser* p, struct Parser_Error* error) // if we have a named argument, we need to add it to the names array, // otherwise we just add an empty string. - string_array_add(&argument_names, name); + array_push(&argument_names, &name); if (parser_probe(p, TOKEN_COMMA)) { parser_next(p); @@ -538,7 +538,7 @@ parser_argument_group_node(struct Parser* p, struct Parser_Error* error) struct Bare_Declaration_Node parser_bare_declaration_node(struct Parser* p, struct Parser_Error* error) { - struct String_Array names = string_array_new(); + Array(struct String) names = array_new(struct String, 16); struct Span span = { 0 }; struct Cursor location = parser_peek(p).location; @@ -547,7 +547,7 @@ parser_bare_declaration_node(struct Parser* p, struct Parser_Error* error) CHECK_RETURN(parser_need(p, TOKEN_NAME, error), struct Bare_Declaration_Node); span = span_is_empty(span) ? name_token.span : span_merge(span, name_token.span); - string_array_add(&names, name_token.value.name); + array_push(&names, &name_token.value.name); struct Token next = parser_peek(p); if (token_can_begin_type(&next)) break; |
