X-Git-Url: http://git.megacz.com/?p=sbp.git;a=blobdiff_plain;f=src%2Fedu%2Fberkeley%2Fsbp%2Fchr%2FCharAtom.java;h=45c85b95a1ca94c7af6f891a2b0746d216db94d0;hp=c729b540ee2ae7cd67cb3353fb768093c40f71ab;hb=987a3f1d9ae796bb8db1294654125b07255128a5;hpb=e014c992f89fea2185be2d249d894e588524daad;ds=sidebyside 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(); }