ref: split parser into separate files

This commit is contained in:
samsonium
2026-10-29 00:08:44 +03:00
parent 62b0030e4a
commit 8c90d54782
27 changed files with 1444 additions and 1307 deletions
+20
View File
@@ -0,0 +1,20 @@
#include <compiler/fzl_parser.h>
#include <compiler/internals/parser.h>
#include <stdio.h>
// `while` and `for` loops
fzl_node_t *pa_loop(fzl_parser_t *parser)
{
if (!peek(parser))
return NULL;
if (is(parser, FZL_TOKTYPE_FOR))
return pa_for(parser);
else if (is(parser, FZL_TOKTYPE_WHILE))
return pa_while(parser);
snprintf(plast_err, sizeof(plast_err),
"'%s': unknown type of loop at %ld:%ld", last_known_tok->filename,
last_known_tok->ln, last_known_tok->cn);
return NULL;
}