This commit is contained in:
Scarlett
2025-04-08 16:01:36 -04:00
parent 87659ebf46
commit a4dc3d90be
5 changed files with 82 additions and 25 deletions

View File

@ -913,7 +913,7 @@ void print_symbol_table(SymbolTable *table, FILE *file_ptr) {
if (table->Parent_Scope == NULL) {
fprintf(file_ptr, "%-*s:%-*s:%-*s:%-*s:%-*s:\n",
col_widths[0], " NAME",
col_widths[0], "NAME",
col_widths[1], " SCOPE",
col_widths[2], " PARENT",
col_widths[3], " TYPE",
@ -965,7 +965,11 @@ void print_symbol_table(SymbolTable *table, FILE *file_ptr) {
if (parentScopeNum == 0) {
st_fprint(file_ptr, entry->theName, currentScopeNum, -100, " Primitive", primAdInfo);
} else {
st_fprint(file_ptr, entry->theName, currentScopeNum, parentScopeNum, " Primitive", primAdInfo);
printdebug("%sTHIS ONE", COLOR_RED);
printTableNode(entry);
char *primType = (char *)malloc(sizeof(getType(entry) + 1));
sprintf(primType, " %s", getType(entry));
st_fprint(file_ptr, entry->theName, currentScopeNum, parentScopeNum, primType, primAdInfo);
}
}