@@ -23,15 +23,11 @@ import (
2323 "github.com/google/cel-go/common/types"
2424 "github.com/google/cel-go/common/types/ref"
2525 "github.com/google/cel-go/common/types/traits"
26-
27- exprpb "google.golang.org/genproto/googleapis/api/expr/v1alpha1"
2826)
2927
3028var (
3129 stdFunctions []* decls.FunctionDecl
32- stdFnDecls []* exprpb.Decl
3330 stdTypes []* decls.VariableDecl
34- stdTypeDecls []* exprpb.Decl
3531)
3632
3733func init () {
@@ -55,15 +51,6 @@ func init() {
5551 decls .TypeVariable (types .UintType ),
5652 }
5753
58- stdTypeDecls = make ([]* exprpb.Decl , 0 , len (stdTypes ))
59- for _ , stdType := range stdTypes {
60- typeVar , err := decls .VariableDeclToExprDecl (stdType )
61- if err != nil {
62- panic (err )
63- }
64- stdTypeDecls = append (stdTypeDecls , typeVar )
65- }
66-
6754 stdFunctions = []* decls.FunctionDecl {
6855 // Logical operators. Special-cased within the interpreter.
6956 // Note, the singleton binding prevents extensions from overriding the operator behavior.
@@ -576,46 +563,18 @@ func init() {
576563 decls .MemberOverload (overloads .DurationToMilliseconds ,
577564 argTypes (types .DurationType ), types .IntType )),
578565 }
579-
580- stdFnDecls = make ([]* exprpb.Decl , 0 , len (stdFunctions ))
581- for _ , fn := range stdFunctions {
582- if fn .IsDeclarationDisabled () {
583- continue
584- }
585- ed , err := decls .FunctionDeclToExprDecl (fn )
586- if err != nil {
587- panic (err )
588- }
589- stdFnDecls = append (stdFnDecls , ed )
590- }
591566}
592567
593568// Functions returns the set of standard library function declarations and definitions for CEL.
594569func Functions () []* decls.FunctionDecl {
595570 return stdFunctions
596571}
597572
598- // FunctionExprDecls returns the legacy style protobuf-typed declarations for all functions and overloads
599- // in the CEL standard environment.
600- //
601- // Deprecated: use Functions
602- func FunctionExprDecls () []* exprpb.Decl {
603- return stdFnDecls
604- }
605-
606573// Types returns the set of standard library types for CEL.
607574func Types () []* decls.VariableDecl {
608575 return stdTypes
609576}
610577
611- // TypeExprDecls returns the legacy style protobuf-typed declarations for all types in the CEL
612- // standard environment.
613- //
614- // Deprecated: use Types
615- func TypeExprDecls () []* exprpb.Decl {
616- return stdTypeDecls
617- }
618-
619578func notStrictlyFalse (value ref.Val ) ref.Val {
620579 if types .IsBool (value ) {
621580 return value
0 commit comments