ref: split parser into separate files
This commit is contained in:
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user