Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into move-test-proto-go-mod
Browse files Browse the repository at this point in the history
  • Loading branch information
l46kok committed Apr 15, 2024
2 parents ce9318c + 148d29d commit 92b42ae
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 55 deletions.
3 changes: 1 addition & 2 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,9 @@ go_repository(
version = "v4.13.0",
)

# CEL Spec deps v0.15.0
go_repository(
name = "com_google_cel_spec",
commit = "ae15d293dc49482180e967942612fb85e33bcde9",
commit = "1bc3fb168317fa77d1227c52d0becbf2d358c023",
importpath = "github.com/google/cel-spec",
)

Expand Down
4 changes: 2 additions & 2 deletions cel/library.go
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ func optMap(meh MacroExprFactory, target ast.Expr, args []ast.Expr) (ast.Expr, *
meh.NewList(),
unusedIterVar,
varName,
meh.NewMemberCall(valueFunc, target),
meh.NewMemberCall(valueFunc, meh.Copy(target)),
meh.NewLiteral(types.False),
meh.NewIdent(varName),
mapExpr,
Expand All @@ -430,7 +430,7 @@ func optFlatMap(meh MacroExprFactory, target ast.Expr, args []ast.Expr) (ast.Exp
meh.NewList(),
unusedIterVar,
varName,
meh.NewMemberCall(valueFunc, target),
meh.NewMemberCall(valueFunc, meh.Copy(target)),
meh.NewLiteral(types.False),
meh.NewIdent(varName),
mapExpr,
Expand Down
1 change: 1 addition & 0 deletions conformance/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ ALL_TESTS = [
"@com_google_cel_spec//tests/simple:testdata/logic.textproto",
"@com_google_cel_spec//tests/simple:testdata/macros.textproto",
"@com_google_cel_spec//tests/simple:testdata/namespace.textproto",
"@com_google_cel_spec//tests/simple:testdata/optionals.textproto",
"@com_google_cel_spec//tests/simple:testdata/parse.textproto",
"@com_google_cel_spec//tests/simple:testdata/plumbing.textproto",
"@com_google_cel_spec//tests/simple:testdata/proto2.textproto",
Expand Down
61 changes: 11 additions & 50 deletions repl/appengine/web/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ func (s *ConformanceServer) Parse(ctx context.Context, in *confpb.ParseRequest)
if in.DisableMacros {
parseOptions = append(parseOptions, cel.ClearMacros())
}
parseOptions = append(parseOptions, cel.OptionalTypes())
env, _ := cel.NewEnv(parseOptions...)
past, iss := env.Parse(in.CelSource)
resp := confpb.ParseResponse{}
Expand Down Expand Up @@ -75,6 +76,7 @@ func (s *ConformanceServer) Check(ctx context.Context, in *confpb.CheckRequest)
checkOptions = append(checkOptions, cel.Declarations(in.TypeEnv...))
checkOptions = append(checkOptions, cel.Types(&test2pb.TestAllTypes{}))
checkOptions = append(checkOptions, cel.Types(&test3pb.TestAllTypes{}))
checkOptions = append(checkOptions, cel.OptionalTypes())
env, _ := cel.NewCustomEnv(checkOptions...)

// Check the expression.
Expand Down Expand Up @@ -254,5 +256,6 @@ var evalEnv *cel.Env
func init() {
evalEnv, _ = cel.NewEnv(
cel.Types(&test2pb.TestAllTypes{}, &test3pb.TestAllTypes{}),
cel.EagerlyValidateDeclarations(true))
cel.EagerlyValidateDeclarations(true),
cel.OptionalTypes())
}

0 comments on commit 92b42ae

Please sign in to comment.