Skip to content
Snippets Groups Projects
Commit 49dd10de authored by FlorianKrull's avatar FlorianKrull
Browse files

Removed global level for printing

parent 157e76cf
No related branches found
No related tags found
No related merge requests found
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
void mcc_symbol_table_print_error(struct mcc_symbol_table_error_collector *ec, FILE *out); void mcc_symbol_table_print_error(struct mcc_symbol_table_error_collector *ec, FILE *out);
void mcc_symbol_table_print(struct mcc_symbol_table *sym, FILE *out,int level); void mcc_symbol_table_print(struct mcc_symbol_table *sym, FILE *out);
void mcc_symbol_table_print_type_check_trace(struct mcc_symbol_table_error_collector *ec, FILE *out); void mcc_symbol_table_print_type_check_trace(struct mcc_symbol_table_error_collector *ec, FILE *out);
......
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
#include "mcc/symbol_table.h" #include "mcc/symbol_table.h"
#include "mcc/symbol_table_print.h" #include "mcc/symbol_table_print.h"
int global_level;
static char *type_to_string(enum mcc_ast_data_type type){ static char *type_to_string(enum mcc_ast_data_type type){
switch (type) switch (type)
...@@ -30,7 +29,7 @@ static char *symbol_type_to_string(enum mcc_symbol_type type){ ...@@ -30,7 +29,7 @@ static char *symbol_type_to_string(enum mcc_symbol_type type){
} }
} }
void mcc_symbol_table_print(struct mcc_symbol_table *symbol_table, FILE *out, int level){ void mcc_symbol_table_print(struct mcc_symbol_table *symbol_table, FILE *out){
printf("----------------------------------\n"); printf("----------------------------------\n");
printf("Table: %s // Child of: %s\n", symbol_table ? symbol_table->sym_table_name : "no name", printf("Table: %s // Child of: %s\n", symbol_table ? symbol_table->sym_table_name : "no name",
symbol_table->parent ? symbol_table->parent->sym_table_name : "no parent"); symbol_table->parent ? symbol_table->parent->sym_table_name : "no parent");
...@@ -40,10 +39,7 @@ void mcc_symbol_table_print(struct mcc_symbol_table *symbol_table, FILE *out, in ...@@ -40,10 +39,7 @@ void mcc_symbol_table_print(struct mcc_symbol_table *symbol_table, FILE *out, in
if(sym->symbol_type != MCC_SYMBOL_TYPE_FUNCTION){ if(sym->symbol_type != MCC_SYMBOL_TYPE_FUNCTION){
fprintf(out,"\t"); fprintf(out,"\t");
} }
for(int j = 1;j < global_level;j++){
fprintf(out,"\t");
}
fprintf(out,"%*s | ", 15, symbol_type_to_string(sym->symbol_type)); fprintf(out,"%*s | ", 15, symbol_type_to_string(sym->symbol_type));
fprintf(out,"%*s | ", 6, type_to_string(sym->data_type)); fprintf(out,"%*s | ", 6, type_to_string(sym->data_type));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment