Commit 1b3b51f7 authored by Robert Griesemer's avatar Robert Griesemer

more useful error string

R=r
DELTA=5  (4 added, 0 deleted, 1 changed)
OCL=29088
CL=29090
parent 02f13e47
......@@ -50,7 +50,11 @@ func (p ErrorList) Less(i, j int) bool { return p[i].Pos.Offset < p[j].Pos.Offs
func (p ErrorList) String() string {
return fmt.Sprintf("%d syntax errors", len(p));
switch len(p) {
case 0: return "unspecified error";
case 1: return p[0].String();
}
return fmt.Sprintf("%s (and %d more errors)", p[0].String(), len(p) - 1);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment