Commit 6dfa6f13 authored by Benoît Simonneaux's avatar Benoît Simonneaux

compiler/parser: Add loop_debug_data().

parent 36f398f5
......@@ -899,6 +899,15 @@ failed:
return -1;
}
static int loop_debug_data(const struct bm_ast_node *node, int indent_lvl)
{
const struct bm_ast_node_data_loop *data = &node->data.as_loop;
wprintf(L",\n%*ls\"count\": %d", indent_lvl * 2, L"", data->count);
return 0;
}
static int parse_loop(struct parser_ctx *ctx, unsigned long *cur_tok_id, struct bm_ast_node *out)
{
int result;
......@@ -911,6 +920,7 @@ static int parse_loop(struct parser_ctx *ctx, unsigned long *cur_tok_id, struct
i++;
parser_node_init(&loop, BM_AST_NODE_LOOP);
loop.debug_data = loop_debug_data;
loop.data.as_loop.count = -1;
if (ctx->in->tokens[i].type == BM_TOK_IMM_INT)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment