Commit 6704bc04 authored by Benoît Simonneaux's avatar Benoît Simonneaux

compiler/parser: Add val_var_sub_debug_data().

parent e707c08d
......@@ -304,6 +304,15 @@ static int val_var_sub_dtor(struct bm_ast_node *node)
return 0;
}
static int val_var_sub_debug_data(const struct bm_ast_node *node, int indent_lvl)
{
const struct bm_ast_node_data_val_var_sub *data = &node->data.as_val_var_sub;
wprintf(L",\n%*ls\"name\": \"%ls\"", indent_lvl * 2, L"", data->name);
return 0;
}
static int parse_val_var_sub(struct parser_ctx *ctx, unsigned long *cur_tok_id, struct bm_ast_node *left_expr, struct bm_ast_node *out)
{
int result;
......@@ -316,6 +325,7 @@ static int parse_val_var_sub(struct parser_ctx *ctx, unsigned long *cur_tok_id,
parser_node_init(&val, BM_AST_NODE_VAL_VAR_SUB);
val.dtor = val_var_sub_dtor;
val.debug_data = val_var_sub_debug_data;
if (ctx->in->tokens[i].type == BM_TOK_IDENTIFIER)
{
......
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