Bump cel-go to v0.17.6

This commit is contained in:
Joe Betz
2023-08-18 14:20:35 -04:00
parent fb785f1f42
commit 1a850a0063
108 changed files with 6743 additions and 3602 deletions

View File

@@ -22,7 +22,7 @@ import (
// Errors type which contains a list of errors observed during parsing.
type Errors struct {
errors []Error
errors []*Error
source Source
numErrors int
maxErrorsToReport int
@@ -31,7 +31,7 @@ type Errors struct {
// NewErrors creates a new instance of the Errors type.
func NewErrors(source Source) *Errors {
return &Errors{
errors: []Error{},
errors: []*Error{},
source: source,
maxErrorsToReport: 100,
}
@@ -39,11 +39,17 @@ func NewErrors(source Source) *Errors {
// ReportError records an error at a source location.
func (e *Errors) ReportError(l Location, format string, args ...any) {
e.ReportErrorAtID(0, l, format, args...)
}
// ReportErrorAtID records an error at a source location and expression id.
func (e *Errors) ReportErrorAtID(id int64, l Location, format string, args ...any) {
e.numErrors++
if e.numErrors > e.maxErrorsToReport {
return
}
err := Error{
err := &Error{
ExprID: id,
Location: l,
Message: fmt.Sprintf(format, args...),
}
@@ -51,12 +57,12 @@ func (e *Errors) ReportError(l Location, format string, args ...any) {
}
// GetErrors returns the list of observed errors.
func (e *Errors) GetErrors() []Error {
func (e *Errors) GetErrors() []*Error {
return e.errors[:]
}
// Append creates a new Errors object with the current and input errors.
func (e *Errors) Append(errs []Error) *Errors {
func (e *Errors) Append(errs []*Error) *Errors {
return &Errors{
errors: append(e.errors, errs...),
source: e.source,