ref: add type/classname result for each gen_* function
This commit is contained in:
@@ -1,18 +1,21 @@
|
||||
#include <common/fzl_types.h>
|
||||
#include <compiler/internals/gen.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdio.h>
|
||||
|
||||
// Format string
|
||||
bool gen_fmtstr(fzl_gen_t *gen, fzl_node_t *node)
|
||||
gen_res_t gen_fmtstr(fzl_gen_t *gen, fzl_node_t *node)
|
||||
{
|
||||
if (!gen || !node)
|
||||
return false;
|
||||
return (gen_res_t){.error = true};
|
||||
|
||||
for (size_t i = 0; i < node->list.entry_count; i++)
|
||||
if (!gen_common(gen, node->list.entries[i]))
|
||||
return false;
|
||||
if (gen_common(gen, node->list.entries[i]).error)
|
||||
return (gen_res_t){.error = true};
|
||||
|
||||
gen_op(gen, FZL_OPCODE_BUILD_STR);
|
||||
gen_word(gen, node->list.entry_count);
|
||||
|
||||
return true;
|
||||
return (gen_res_t){
|
||||
.error = false, .type = FZL_TYPE_STRING, .classname = NULL};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user