From e188aa3f962df621fc49097418959c7d00ce9969 Mon Sep 17 00:00:00 2001 From: bd-912 Date: Fri, 19 Apr 2024 19:36:03 -0600 Subject: Global PrintFilter -> MinimalLogger --- typecheck/library/TypeCheckSimp.java | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) (limited to 'typecheck/library/TypeCheckSimp.java') diff --git a/typecheck/library/TypeCheckSimp.java b/typecheck/library/TypeCheckSimp.java index b50fa53..b330c65 100644 --- a/typecheck/library/TypeCheckSimp.java +++ b/typecheck/library/TypeCheckSimp.java @@ -15,20 +15,21 @@ public class TypeCheckSimp extends GJDepthFirst { private int offset; private void printNode(Node n, SymbolTable symt, boolean enter, TypeEnum consensus) { + String str = ""; for (int i=0; i < this.offset; ++i) - PrintFilter.print(".", false); + str += "."; if (enter) - PrintFilter.print("Visiting ", false); + str += "Visiting "; else - PrintFilter.print("Leaving ", false); - PrintFilter.print(n.getClass().getSimpleName(), false); + str += "Leaving "; + str += "n.getClass().getSimpleName()"; if (!enter) { if (consensus == TypeEnum.ERROR) - PrintFilter.print(" did not type check.", false); + str += " did not type check."; else - PrintFilter.print(" found type " + consensus, false); + str += String.format(" found type %s", consensus); } - PrintFilter.print("", true); + MinimalLogger.info(str); } public TypeInstance visit(NodeList n, SymbolTable symt) { @@ -110,11 +111,13 @@ public class TypeCheckSimp extends GJDepthFirst { public TypeInstance visit(NodeToken n, SymbolTable symt) { // A fixed string token. '⌣' + String str = ""; for (int i=0; i < this.offset; ++i) - PrintFilter.print(".", false); - PrintFilter.print("Leaving " + n.getClass().getSimpleName() + - " => " + - n.toString(), true); + str += "."; + MinimalLogger.info(String.format("%sLeaving %s => %s", + str, + n.getClass().getSimpleName(), + n.toString())); return null; } -- cgit v1.2.3