mirror of
https://github.com/optim-enterprises-bv/kubernetes.git
synced 2025-12-07 08:35:35 +00:00
Update cel-go to v0.21.0
This commit is contained in:
20
vendor/github.com/google/cel-go/parser/helper.go
generated
vendored
20
vendor/github.com/google/cel-go/parser/helper.go
generated
vendored
@@ -140,15 +140,12 @@ func (p *parserHelper) id(ctx any) int64 {
|
||||
var offset ast.OffsetRange
|
||||
switch c := ctx.(type) {
|
||||
case antlr.ParserRuleContext:
|
||||
start, stop := c.GetStart(), c.GetStop()
|
||||
if stop == nil {
|
||||
stop = start
|
||||
}
|
||||
start := c.GetStart()
|
||||
offset.Start = p.sourceInfo.ComputeOffset(int32(start.GetLine()), int32(start.GetColumn()))
|
||||
offset.Stop = p.sourceInfo.ComputeOffset(int32(stop.GetLine()), int32(stop.GetColumn()))
|
||||
offset.Stop = offset.Start + int32(len(c.GetText()))
|
||||
case antlr.Token:
|
||||
offset.Start = p.sourceInfo.ComputeOffset(int32(c.GetLine()), int32(c.GetColumn()))
|
||||
offset.Stop = offset.Start
|
||||
offset.Stop = offset.Start + int32(len(c.GetText()))
|
||||
case common.Location:
|
||||
offset.Start = p.sourceInfo.ComputeOffset(int32(c.Line()), int32(c.Column()))
|
||||
offset.Stop = offset.Start
|
||||
@@ -164,10 +161,21 @@ func (p *parserHelper) id(ctx any) int64 {
|
||||
return id
|
||||
}
|
||||
|
||||
func (p *parserHelper) deleteID(id int64) {
|
||||
p.sourceInfo.ClearOffsetRange(id)
|
||||
if id == p.nextID-1 {
|
||||
p.nextID--
|
||||
}
|
||||
}
|
||||
|
||||
func (p *parserHelper) getLocation(id int64) common.Location {
|
||||
return p.sourceInfo.GetStartLocation(id)
|
||||
}
|
||||
|
||||
func (p *parserHelper) getLocationByOffset(offset int32) common.Location {
|
||||
return p.getSourceInfo().GetLocationByOffset(offset)
|
||||
}
|
||||
|
||||
// buildMacroCallArg iterates the expression and returns a new expression
|
||||
// where all macros have been replaced by their IDs in MacroCalls
|
||||
func (p *parserHelper) buildMacroCallArg(expr ast.Expr) ast.Expr {
|
||||
|
||||
Reference in New Issue
Block a user