commit cb37a166adec1d34f3055566010f295af1a4e3fa
parent 2b80239d00f48e844e86b77d9c63267c12c79efc
Author: m21c <ho*******@gmail.com>
Date: Sat, 5 Feb 2022 13:08:24 +0100
better debug printing for pending environments + end of compilation
Diffstat:
1 file changed, 22 insertions(+), 1 deletion(-)
diff --git a/compiler.c b/compiler.c
@@ -4824,13 +4824,34 @@ main(int argc, char **argv)
}
}
+ highlight(stdout, HLINFO);
+ puts("dump pending environments ...");
+ highlight(stdout, HLNONE);
+
for (p = source->pendingenvhead; p; p = p->pendingnext) {
- if (p->stmts)
+ if (p->stmts) {
p->stmts = foldexpr(source->currenv, typecheck(source->currenv, p->stmts));
+
+ /* debug prints: */
+ highlight(stdout, HLINFO);
+ printf("statements:\n");
+ highlight(stdout, HLNONE);
+ printexpr(stdout, p->stmts, 1);
+
+ highlight(stdout, HLINFO);
+ fputs(" : ", stdout);
+ printtype(stdout, p->stmts->type, 0);
+ highlight(stdout, HLNONE);
+
+ printf("\n");
+ }
}
popenv(source);
+ highlight(stdout, HLINFO);
+ puts("exiting ...\x1b[0m");
+
/* fclose(source->filein); */
/* disposestrmap(&strings); */
/* disposestrmap(&idents); */