diff options
author | bd-912 <bdunahu@colostate.edu> | 2024-04-19 19:36:03 -0600 |
---|---|---|
committer | bd-912 <bdunahu@colostate.edu> | 2024-04-19 19:36:03 -0600 |
commit | e188aa3f962df621fc49097418959c7d00ce9969 (patch) | |
tree | c575bd207e9715b6acdc1e655c93209453efffa1 /typecheck | |
parent | 7b93ef1ec7cb51f3494d7f18cc39dd9d26a24be8 (diff) |
Global PrintFilter -> MinimalLogger
Diffstat (limited to 'typecheck')
-rw-r--r-- | typecheck/library/TypeCheckSimp.java | 25 |
1 files changed, 14 insertions, 11 deletions
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<TypeInstance,SymbolTable> { 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<TypeInstance,SymbolTable> { 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; } |