more accurate positions in CharInput
[sbp.git] / src / edu / berkeley / sbp / chr / CharInput.java
index 3ebbb88..8814f79 100644 (file)
@@ -95,11 +95,6 @@ public class CharInput extends Cartesian.Input<Character> {
         Character ret = __next();
         if (ret==null) return null;
         char c = ret.charValue();
-        if (indent) {
-            if (ret==CharAtom.left)  System.out.print("\033[31m{\033[0m");
-            else if (ret==CharAtom.right) System.out.print("\033[31m}\033[0m");
-            else System.out.print(c+"");
-        }
         return ret;
     }
     public Character __next() throws IOException {
@@ -160,8 +155,8 @@ public class CharInput extends Cartesian.Input<Character> {
     public String showRegion(Region<Character> rc, int maxLength) {
         if (cache == null) return null;
         Cartesian.Region r = (Cartesian.Region)rc;
-        int start = r.getStart().getScalar()+1;
-        int end = r.getEnd().getScalar()+1;
+        int start = r.getStart().getScalar();
+        int end = r.getEnd().getScalar();
         if (start < 0) start = 0;
         if (end < start) end = start;
         if (end > cache.length()) end = cache.length();
@@ -181,4 +176,5 @@ public class CharInput extends Cartesian.Input<Character> {
         return cache.substring(start, end);
     }
 
+    public void close() { }
 }