projects
/
sbp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
vast improvement in error reporting
[sbp.git]
/
src
/
edu
/
berkeley
/
sbp
/
GSS.java
diff --git
a/src/edu/berkeley/sbp/GSS.java
b/src/edu/berkeley/sbp/GSS.java
index
b36b293
..
5255a21
100644
(file)
--- 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)
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;
}
return true;
}
@@
-253,14
+257,22
@@
class GSS {
}
if (!good && token!=null)
}
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)
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);
}
}