X-Git-Url: http://git.megacz.com/?p=sbp.git;a=blobdiff_plain;f=src%2Fedu%2Fberkeley%2Fsbp%2FGSS.java;h=5255a21a65da9649d02dc0af5c5b998d82b49a66;hp=b36b293094276d048676d096e3258779394df973;hb=62be1c1ae2ac13086b508e34eeffdb7e536d5b61;hpb=2c05c84a714f54b3bc026f51416492ddb13f33b1 diff --git a/src/edu/berkeley/sbp/GSS.java b/src/edu/berkeley/sbp/GSS.java index b36b293..5255a21 100644 --- a/src/edu/berkeley/sbp/GSS.java +++ b/src/edu/berkeley/sbp/GSS.java @@ -94,9 +94,13 @@ class GSS { public boolean isDone() throws ParseFailed { if (token != null) return false; if (token==null && finalResult==null) - throw new ParseFailed(ParseFailed.error(("unexpected end of file\n"), - token, hash.values()), - getLocation().createRegion(getLocation()), input); + ParseFailed.error("unexpected end of file", + getLocation(), + token, + hash.values(), + getLocation().createRegion(getLocation()), + input, + GSS.this); return true; } @@ -253,14 +257,22 @@ class GSS { } if (!good && token!=null) - throw new ParseFailed(ParseFailed.error(("unexpected character ")+" \'"+ - ANSI.purple(StringUtil.escapify(token+"", "\\\'\r\n"))+ - "\' encountered at "+ - ANSI.green(next.getRegion())+"\n", token, hash.values()), - next.getRegion(), input); + ParseFailed.error("unexpected character", + getLocation(), + token, + hash.values(), + getRegion(), + input, + GSS.this); + if (token==null && finalResult==null) - throw new ParseFailed(ParseFailed.error(("unexpected end of file at "+getLocation()+"\n"), token, hash.values()), - getLocation().createRegion(getLocation()), input); + ParseFailed.error("unexpected end of file", + getLocation(), + token, + hash.values(), + getLocation().createRegion(getLocation()), + input, + GSS.this); }