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