X-Git-Url: http://git.megacz.com/?p=sbp.git;a=blobdiff_plain;f=src%2Fedu%2Fberkeley%2Fsbp%2Fchr%2FCharParser.java;h=9bdadbc1e90697c54588c3d7b292287b1e5fd9bc;hp=8630161d8feefb81f4cb56bfb004174c6f9fb48b;hb=82f9b8d4a2fadb14cb004e5cc9f14944458f2e6c;hpb=189d68c64f7aaec90b7cdef0fb2c358fe4f0dd21 diff --git a/src/edu/berkeley/sbp/chr/CharParser.java b/src/edu/berkeley/sbp/chr/CharParser.java index 8630161..9bdadbc 100644 --- a/src/edu/berkeley/sbp/chr/CharParser.java +++ b/src/edu/berkeley/sbp/chr/CharParser.java @@ -15,8 +15,13 @@ public class CharParser extends Parser { public CharParser(Union u) { super(u, new CharTopology()); } - public Forest shiftToken(Location oldloc, Character ct, Location newloc) { - return Forest.create(new Input.Region(oldloc, newloc), ct.toString(), null, false); + private Location oldloc; + + public Forest shiftToken(Character ct, Location newloc) { + if (oldloc==null) oldloc = newloc; + Forest ret = Forest.create(oldloc.createRegion(newloc), ct.toString(), null, false); + oldloc = newloc; + return ret; } }