Commit 36f398f5 authored by Benoît Simonneaux's avatar Benoît Simonneaux

compiler/parser: Add op_cast_debug_data().

parent 6704bc04
......@@ -530,6 +530,17 @@ static int op_cast_dtor(struct bm_ast_node *node)
return 0;
}
static int op_cast_debug_data(const struct bm_ast_node *node, int indent_lvl)
{
const struct bm_ast_node_data_op_cast *data = &node->data.as_op_cast;
wprintf(L",\n%*ls\"cast_type\": \"", indent_lvl * 2, L"");
debug_type(&data->type);
wprintf(L"\"");
return 0;
}
static int parse_op_cast(struct parser_ctx *ctx, unsigned long *cur_tok_id, struct bm_ast_node *out)
{
int result;
......@@ -543,6 +554,7 @@ static int parse_op_cast(struct parser_ctx *ctx, unsigned long *cur_tok_id, stru
parser_node_init(&cast, BM_AST_NODE_OP_CAST);
cast.dtor = op_cast_dtor;
cast.debug_data = op_cast_debug_data;
result = parse_type(ctx, &i, &cast.data.as_op_cast.type);
if (result < 0)
......
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