start working on parser

This commit is contained in:
2025-05-30 22:23:46 +01:00
parent ec894d4357
commit d18ff96f8f
8 changed files with 51 additions and 30 deletions

View File

@@ -16,8 +16,11 @@ ParsedValue *parse_token(DArray *tokens, size_t *index) {
case TOKEN_NEW_LINE:
(*index)++;
return NULL;
case TOKEN_INDENT:
fprintf(stderr, "error: \n");
exit(EXIT_FAILURE);
default:
fprintf(stderr, "Panic: %s\n", "unreachable");
fprintf(stderr, "Panic: unreachable\n");
exit(EXIT_FAILURE);
}
}
@@ -40,6 +43,5 @@ void free_parsed_value(void *ptr) {
case AST_STRING:
free(tagged->data);
break;
// Add cases if needed
}
}