finished more type check stuff and some loops

This commit is contained in:
Partho
2025-04-30 02:27:52 -04:00
parent 6d26ba25b0
commit f2affd8a55
3 changed files with 16 additions and 9 deletions

View File

@ -27,7 +27,7 @@ char *temp_var_gen() {
}
char *arg_var_gen() {
char *ret = calloc(9, sizeof(*ret));
sprintf(ret, "&t%d", temp3_count);
sprintf(ret, "&%d", temp3_count);
temp3_count++;
return ret;
}
@ -1216,6 +1216,9 @@ void print_symbol_table(SymbolTable *table, FILE *file_ptr) {
}
for (; entry != NULL; entry = getNextEntry(entry)) {
if((getName(entry)[0] == '$' || getName(entry)[0] == '&') && ir_flag == NULL){
continue;
}
if (getAdInfoType(entry) == TYPE_ARRAY_TYPE) {
char *arrayType = (char *)malloc(100);
sprintf(arrayType, " %d -> %s", getNumArrDim(entry),