Tweak (penv) formatting.

Remove unused include from hash.c
This commit is contained in:
Sage Vaillancourt 2022-04-05 16:53:21 -04:00 committed by Sage Vaillancourt
parent 61b9f79c36
commit 5ca9fdb042
2 changed files with 4 additions and 6 deletions

View File

@ -234,11 +234,7 @@ void printEnv(struct Environment* env, int printPointers)
if (env->table.elements[i].symbol == NULL) { if (env->table.elements[i].symbol == NULL) {
continue; continue;
} }
if (printPointers) { printf("%s: ", env->table.elements[i].symbol);
printf("[%d]: `%s` %p :: ", i, env->table.elements[i].symbol, env->table.elements[i].symbol);
} else {
printf("[%d]: `%s` :: ", i, env->table.elements[i].symbol);
}
printf(""); printf("");
if (env->table.elements[i].object.type == TYPE_STRING) { if (env->table.elements[i].object.type == TYPE_STRING) {
printf("\""); printf("\"");
@ -254,6 +250,9 @@ void printEnv(struct Environment* env, int printPointers)
} }
free(s); free(s);
} }
if (printPointers) {
printf(" @ %p", env->table.elements[i].symbol);
}
printf("\n"); printf("\n");
} }
} }

View File

@ -1,7 +1,6 @@
#include "hash.h" #include "hash.h"
#include "env.h" #include "env.h"
#include <search.h>
#include <string.h> #include <string.h>
static unsigned long hash(const char *str) static unsigned long hash(const char *str)