Changed the print of globals

main
Øyvind Skaaden 2022-03-18 19:47:32 +01:00
parent a92ee8c187
commit 4793e4e934
1 changed files with 18 additions and 9 deletions

View File

@ -59,7 +59,7 @@ print_global_tree(symbol_t* global)
if (!global)
return;
printf("─%s(%s, nparams=%ld, seq=%ld, node=%p)\n",
printf("─%s: %-16s [nparams=%2ld, seq=%2ld, node=%p]\n",
symbol_names[global->type],
global->name,
global->nparms,
@ -75,13 +75,21 @@ print_global_tree(symbol_t* global)
tlhash_values(global->locals, (void **)locals_list );
for (int l = 0; l < no_locals; l++)
{
printf(" %s─%s(%s, seq=%ld, node=%p)\n",
(l < (no_locals - 1)) ? "" : "",
symbol_names[locals_list[l]->type],
locals_list[l]->name,
locals_list[l]->seq,
locals_list[l]->node
);
for (int ll = 0; ll < no_locals; ll++)
{
if (locals_list[ll]->seq == l)
{
printf(" %s─[%s]: %-22s\t[seq=%2ld, node=%p]\n",
(l < (no_locals - 1)) ? "" : "",
symbol_names[locals_list[ll]->type],
locals_list[ll]->name,
locals_list[ll]->seq,
locals_list[ll]->node
);
break;
}
}
}
putchar('\n');
free(locals_list);
@ -94,7 +102,8 @@ print_string_list(void)
for (uint64_t i = 0; i < stringc; i++)
printf(" %s─[%ld]: %s\n",
(i < (stringc - 1)) ? "" : "",
i, string_list[i]
i,
string_list[i]
);
}