summaryrefslogtreecommitdiff
path: root/typecheck/library/TypeCheckSimp.java
diff options
context:
space:
mode:
Diffstat (limited to 'typecheck/library/TypeCheckSimp.java')
-rw-r--r--typecheck/library/TypeCheckSimp.java25
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;
}