starting to work on grammar fixes

This commit is contained in:
Partho
2025-04-11 15:45:33 -04:00
parent f6dabd8d03
commit 3e1e159561
3 changed files with 24 additions and 8 deletions

View File

@ -1142,6 +1142,19 @@ void print_symbol_table(SymbolTable *table, FILE *file_ptr) {
}
}
if (getAdInfoType(entry) == TYPE_PRIMITIVE_TYPE) {
char *primAdInfo = (char *)malloc(100);
sprintf(primAdInfo, " size-%d bytes", getPrimSize(getTypeEntry(entry)));
if (parentScopeNum == 0) {
st_fprint(file_ptr, getName(entry), currentScopeNum, -100, " Primitive Type", primAdInfo);
} else {
//printdebug("%sTHIS ONE", COLOR_RED);
printTableNode(entry);
char *primType = (char *)malloc(sizeof(getType(entry) + 1));
sprintf(primType, " %s", getType(entry));
st_fprint(file_ptr, getName(entry), currentScopeNum, parentScopeNum, primType, primAdInfo);
}
}
if (getAdInfoType(entry) == TYPE_PRIMITIVE) {
char *primAdInfo = (char *)malloc(100);
sprintf(primAdInfo, " size-%d bytes", getPrimSize(getTypeEntry(entry)));
@ -1152,7 +1165,7 @@ void print_symbol_table(SymbolTable *table, FILE *file_ptr) {
printTableNode(entry);
char *primType = (char *)malloc(sizeof(getType(entry) + 1));
sprintf(primType, " %s", getType(entry));
st_fprint(file_ptr, getName(entry), currentScopeNum, parentScopeNum, primType, primAdInfo);
st_fprint(file_ptr, getName(entry), currentScopeNum, parentScopeNum, getType(entry), "Primitive Instance");
}
}