Commit e707c08d authored by Benoît Simonneaux's avatar Benoît Simonneaux

compiler/parser: Add val_var_ext_debug_data().

parent 9722d940
......@@ -216,6 +216,24 @@ static int val_var_ext_dtor(struct bm_ast_node *node)
return 0;
}
static int val_var_ext_debug_data(const struct bm_ast_node *node, int indent_lvl)
{
const struct bm_ast_node_data_val_var_ext *data = &node->data.as_val_var_ext;
int result;
wprintf(L",\n%*ls\"class\": \"", indent_lvl * 2, L"");
result = debug_class_path(&data->class_path);
if (result == 0)
wprintf(L".");
wprintf(L"%ls\"", data->class_name);
wprintf(L",\n%*ls\"name\": \"%ls\"", indent_lvl * 2, L"", data->name);
return 0;
}
static int parse_val_var_ext(struct parser_ctx *ctx, unsigned long *cur_tok_id, struct bm_ast_node *out)
{
int result;
......@@ -224,6 +242,7 @@ static int parse_val_var_ext(struct parser_ctx *ctx, unsigned long *cur_tok_id,
parser_node_init(&val, BM_AST_NODE_VAL_VAR_EXT);
val.dtor = val_var_ext_dtor;
val.debug_data = val_var_ext_debug_data;
val.data.as_val_var_ext.class_name = NULL;
val.data.as_val_var_ext.name = NULL;
......
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