Skip to content

Commit 94cbc9d

Browse files
Remove the deprecated protobuf function and type declarations for the standard environment (#921)
1 parent 148d29d commit 94cbc9d

File tree

4 files changed

+0
-79
lines changed

4 files changed

+0
-79
lines changed

checker/BUILD.bazel

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ go_library(
1616
"options.go",
1717
"printer.go",
1818
"scopes.go",
19-
"standard.go",
2019
"types.go",
2120
],
2221
importpath = "github.com/google/cel-go/checker",

checker/standard.go

Lines changed: 0 additions & 35 deletions
This file was deleted.

common/stdlib/BUILD.bazel

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,12 @@ go_library(
1212
],
1313
importpath = "github.com/google/cel-go/common/stdlib",
1414
deps = [
15-
"//checker/decls:go_default_library",
1615
"//common/decls:go_default_library",
1716
"//common/functions:go_default_library",
1817
"//common/operators:go_default_library",
1918
"//common/overloads:go_default_library",
2019
"//common/types:go_default_library",
2120
"//common/types/ref:go_default_library",
2221
"//common/types/traits:go_default_library",
23-
"@org_golang_google_genproto_googleapis_api//expr/v1alpha1:go_default_library",
2422
],
2523
)

common/stdlib/standard.go

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -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

3028
var (
3129
stdFunctions []*decls.FunctionDecl
32-
stdFnDecls []*exprpb.Decl
3330
stdTypes []*decls.VariableDecl
34-
stdTypeDecls []*exprpb.Decl
3531
)
3632

3733
func 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.
594569
func 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.
607574
func 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-
619578
func notStrictlyFalse(value ref.Val) ref.Val {
620579
if types.IsBool(value) {
621580
return value

0 commit comments

Comments
 (0)