remove more Tib junk
[sbp.git] / src / edu / berkeley / sbp / tib / Tib.java
index a3fd568..c2f3468 100644 (file)
@@ -24,7 +24,7 @@ import java.io.*;
  */
 public class Tib implements Input<Character> {
 
-    public String showRegion(Region<Character> r) { return null; }
+    public String showRegion(Region<Character> r) { return ""; }
 
     public Tib(String s) throws IOException { this(new StringReader(s)); }
     public Tib(Reader r) throws IOException { this(new BufferedReader(r)); }
@@ -54,12 +54,15 @@ public class Tib implements Input<Character> {
     boolean indenting = true;
     int indentation = 0;
     private ArrayList<Integer> istack = new ArrayList<Integer>();
+    private static boolean debug = "true".equals(System.getProperty("tib.debug", "false"));
     public Character next() throws IOException {
         Character ret = nextc();
-        if      (ret==null) return null;
-        else if (ret==left)  System.out.print("\033[31m{\033[0m");
-        else if (ret==right) System.out.print("\033[31m}\033[0m");
-        else System.out.print(ret);
+        if (debug) {
+            if      (ret==null) return null;
+            else if (ret==left)  System.out.print("\033[31m{\033[0m");
+            else if (ret==right) System.out.print("\033[31m}\033[0m");
+            else System.out.print(ret);
+        }
         return ret;
     }