make while loop parsing more elegant

It is now possible to parse parts of the program and save the IR for
later addition. This is currently used for while loops but will also make other
control flow elements easier to implement in the future.
This commit is contained in:
r4
2021-12-22 12:52:16 +01:00
parent a8be4540b1
commit e7f4773cba
4 changed files with 69 additions and 59 deletions

4
ir.h
View File

@@ -74,9 +74,11 @@ typedef struct IRToks {
IRTok *toks;
} IRToks;
void irtoks_init(IRToks *v);
void irtoks_init_long(IRToks *v);
void irtoks_init_short(IRToks *v);
void irtoks_term(IRToks *v);
void irtoks_app(IRToks *v, IRTok t);
void irtoks_app_irtoks(IRToks *v, IRToks *other);
void print_ir(IRToks *v);