| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
package parser |
| 16 |
|
| 17 |
import ( |
| 18 |
"github.com/google/cel-go/common" |
| 19 |
) |
| 20 |
|
| 21 |
|
| 22 |
type parseErrors struct { |
| 23 |
errs *common.Errors |
| 24 |
} |
| 25 |
|
| 26 |
|
| 27 |
func (e *parseErrors) errorCount() int { |
| 28 |
return len(e.errs.GetErrors()) |
| 29 |
} |
| 30 |
|
| 31 |
func (e *parseErrors) internalError(message string) { |
| 32 |
e.errs.ReportErrorAtID(0, common.NoLocation, "%s", message) |
| 33 |
} |
| 34 |
|
| 35 |
func (e *parseErrors) syntaxError(l common.Location, message string) { |
| 36 |
e.errs.ReportErrorAtID(0, l, "Syntax error: %s", message) |
| 37 |
} |
| 38 |
|
| 39 |
func (e *parseErrors) reportErrorAtID(id int64, l common.Location, message string, args ...any) { |
| 40 |
e.errs.ReportErrorAtID(id, l, message, args...) |
| 41 |
} |