add list support to parser

This commit is contained in:
2025-06-11 02:08:17 +01:00
parent 55c1500453
commit a47df1ddb0
7 changed files with 85 additions and 11 deletions

View File

@@ -50,6 +50,8 @@ ParsedValue *parse_declaration(char *file, DArray *tokens, size_t *index) {
token = darray_get(tokens, *index);
} else {
while ((*index) < tokens->size) {
skip_newlines_and_indents(tokens, index);
error_if_finished(file, tokens, index);
token = darray_get(tokens, *index);
if (token->type != TOKEN_IDENTIFIER) {
fprintf(stderr,
@@ -104,7 +106,7 @@ ParsedValue *parse_declaration(char *file, DArray *tokens, size_t *index) {
break;
token = darray_get(tokens, *index);
if (token->type != TOKEN_COMMA) {
(*index)-=count;
(*index) -= count;
break;
}
(*index)++;