From: adam Date: Mon, 26 Mar 2007 05:37:42 +0000 (-0400) Subject: minor cleanups to CharInput X-Git-Tag: tag_for_25-Mar~24 X-Git-Url: http://git.megacz.com/?p=sbp.git;a=commitdiff_plain;h=987a3f1d9ae796bb8db1294654125b07255128a5;hp=e014c992f89fea2185be2d249d894e588524daad;ds=sidebyside minor cleanups to CharInput darcs-hash:20070326053742-5007d-8819a00bc26b3f0011ff7c83a0c82b57a2676f6b.gz --- diff --git a/src/edu/berkeley/sbp/chr/CharAtom.java b/src/edu/berkeley/sbp/chr/CharAtom.java index c729b54..45c85b9 100644 --- a/src/edu/berkeley/sbp/chr/CharAtom.java +++ b/src/edu/berkeley/sbp/chr/CharAtom.java @@ -33,7 +33,7 @@ public class CharAtom extends Atom { /** returns an element which exactly matches the string given */ public static Element string(String s) { return string(s, true); } public static Element string(String s, boolean share) { - if (share && s.length() == 0) return epsilon; + if (share && s.length() == 0) return emptyString; final String escapified = "\""+StringUtil.escapify(s, "\"\r\n\\")+"\""; Element ret; if (share && s.length() == 1) { @@ -51,8 +51,11 @@ public class CharAtom extends Atom { return ret; } - private static Union epsilon = new Union("()"); - static { epsilon.add(Sequence.create()); } + private static Union emptyString = new Union("()"); + static { + // FIXME: force this to be dropped wherever used! + emptyString.add(Sequence.create(new Element[0], "")); + } public Topology> unwrap() { return this; } public Topology> empty() { return new CharAtom(); } diff --git a/src/edu/berkeley/sbp/chr/CharInput.java b/src/edu/berkeley/sbp/chr/CharInput.java index 95609bc..2e8e882 100644 --- a/src/edu/berkeley/sbp/chr/CharInput.java +++ b/src/edu/berkeley/sbp/chr/CharInput.java @@ -102,10 +102,8 @@ public class CharInput extends Cartesian.Input { int i = r.read(); if (i==-1) { - /*System.err.print("\r...done \r"); */ if (indent && indentation >= 0) { redent(indentation - lastIndentation); - //System.err.println("\r \rindent: " + (indentation - lastIndentation)); lastIndentation = indentation; indentation = -1; return __next();