generated: ./hack/update-vendor.sh

This commit is contained in:
Jiahui Feng
2024-04-22 10:54:32 -07:00
parent 51af569512
commit 350fcf957e
189 changed files with 14707 additions and 9152 deletions

View File

@@ -22,19 +22,13 @@ import (
"github.com/google/cel-go/common/containers"
"github.com/google/cel-go/common/types"
"github.com/google/cel-go/common/types/ref"
exprpb "google.golang.org/genproto/googleapis/api/expr/v1alpha1"
)
// Interpreter generates a new Interpretable from a checked or unchecked expression.
type Interpreter interface {
// NewInterpretable creates an Interpretable from a checked expression and an
// optional list of InterpretableDecorator values.
NewInterpretable(checked *ast.CheckedAST, decorators ...InterpretableDecorator) (Interpretable, error)
// NewUncheckedInterpretable returns an Interpretable from a parsed expression
// and an optional list of InterpretableDecorator values.
NewUncheckedInterpretable(expr *exprpb.Expr, decorators ...InterpretableDecorator) (Interpretable, error)
NewInterpretable(exprAST *ast.AST, decorators ...InterpretableDecorator) (Interpretable, error)
}
// EvalObserver is a functional interface that accepts an expression id and an observed value.
@@ -177,7 +171,7 @@ func NewInterpreter(dispatcher Dispatcher,
// NewIntepretable implements the Interpreter interface method.
func (i *exprInterpreter) NewInterpretable(
checked *ast.CheckedAST,
checked *ast.AST,
decorators ...InterpretableDecorator) (Interpretable, error) {
p := newPlanner(
i.dispatcher,
@@ -187,19 +181,5 @@ func (i *exprInterpreter) NewInterpretable(
i.container,
checked,
decorators...)
return p.Plan(checked.Expr)
}
// NewUncheckedIntepretable implements the Interpreter interface method.
func (i *exprInterpreter) NewUncheckedInterpretable(
expr *exprpb.Expr,
decorators ...InterpretableDecorator) (Interpretable, error) {
p := newUncheckedPlanner(
i.dispatcher,
i.provider,
i.adapter,
i.attrFactory,
i.container,
decorators...)
return p.Plan(expr)
return p.Plan(checked.Expr())
}