Commit 64f9ce56 authored by Guillaume Charifi's avatar Guillaume Charifi

compiler/parser: Introduce debug_decl().

parent 814b4326
......@@ -694,6 +694,16 @@ int destroy_decl(struct bm_ast_decl *decl)
return 0;
}
static int debug_decl(const struct bm_ast_decl *decl, int indent_lvl)
{
wprintf(L",\n%*ls\"name\": \"%ls\"", indent_lvl * 2, L"", decl->name);
wprintf(L",\n%*ls\"decl_type\": \"", indent_lvl * 2, L"");
debug_type(&decl->type);
wprintf(L"\"");
return 0;
}
int parse_decl(struct parser_ctx *ctx, unsigned long *cur_tok_id, struct bm_ast_decl *out)
{
int result;
......@@ -740,10 +750,7 @@ static int debug_decl_func(const struct bm_ast_decl_func *decl, int indent_lvl)
{
const wchar_t *spc = L"";
wprintf(L",\n%*ls\"name\": \"%ls\"", indent_lvl * 2, L"", decl->base.name);
wprintf(L",\n%*ls\"func_type\": \"", indent_lvl * 2, L"");
debug_type(&decl->base.type);
wprintf(L"\"");
debug_decl(&decl->base, indent_lvl);
wprintf(L",\n%*ls\"params\": [", indent_lvl * 2, L"");
......
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