fixed print symbol table to not print scopes used as flags

This commit is contained in:
Partho
2025-04-02 20:31:00 -04:00
parent 77c4106b1b
commit 3186d363ed
3 changed files with 8 additions and 1 deletions

View File

@ -1139,7 +1139,15 @@ void print_symbol_table(SymbolTable *table, FILE *file_ptr) {
if (getChildren(table) != NULL) {
ListOfTable *node = getChildren(table);
for (; node != NULL; node = node->next) {
if((node->table) == NULL){
print_symbol_table(node->table, file_ptr);
}else{
if ((node->table)->Line_Number == -1){
continue;
}else{
print_symbol_table(node->table, file_ptr);
}
}
}
}
if (getParent(table) == NULL) {

0
test Normal file
View File

View File

@ -24,6 +24,5 @@ entry(arg) := {
w.y := 7;
result := bar1(w); (* pass w (a rec type value) to bar1 *)
result := bar2(5,7); (* implicitly build a rec type value, assign 5 and 7 to fields x and y, but call them r and s *)
arr(3);
return 0;
}