wip: working on generator
- Feat: add break handler - Feat: add class handler - Feat: add format string handler - Feat: add loop handler
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
#include <compiler/internals/gen.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
// Format string
|
||||
bool gen_fmtstr(fzl_gen_t *gen, fzl_node_t *node)
|
||||
{
|
||||
if (!gen || !node)
|
||||
return false;
|
||||
|
||||
for (size_t i = 0; i < node->list.entry_count; i++)
|
||||
if (!gen_common(gen, node->list.entries[i]))
|
||||
return false;
|
||||
|
||||
gen_op(gen, FZL_OPCODE_BUILD_STR);
|
||||
gen_word(gen, node->list.entry_count);
|
||||
|
||||
return true;
|
||||
}
|
||||
Reference in New Issue
Block a user