Debian Codegraph @

checker/options.go

raw symbols SCIP
1 // Copyright 2022 Google LLC
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14
15 package checkerscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/checker`/
16
17 type optionsscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/checker`/options# struct {
18 crossTypeNumericComparisonsscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/checker`/options#crossTypeNumericComparisons. bool
19 homogeneousAggregateLiteralsscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/checker`/options#homogeneousAggregateLiterals. bool
20 validatedDeclarationsscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/checker`/options#validatedDeclarations. *Scopesscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/checker`/Scopes#
21 }
22
23 // Option is a functional option for configuring the type-checker
24 type Optionscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/checker`/Option# func(*optionsscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/checker`/options#) error
25
26 // CrossTypeNumericComparisons toggles type-checker support for numeric comparisons across type
27 // See https://github.com/google/cel-spec/wiki/proposal-210 for more details.
28 func CrossTypeNumericComparisonsscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/checker`/CrossTypeNumericComparisons().(enabled bool) Optionscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/checker`/Option# {
29 return func(opts *optionsscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/checker`/options#) error {
30 opts.crossTypeNumericComparisonsscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/checker`/options#crossTypeNumericComparisons. = enabled
31 return nil
32 }
33 }
34
35 // ValidatedDeclarations provides a references to validated declarations which will be copied
36 // into new checker instances.
37 func ValidatedDeclarationsscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/checker`/ValidatedDeclarations().(env *Envscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/checker`/Env#) Optionscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/checker`/Option# {
38 return func(opts *optionsscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/checker`/options#) error {
39 opts.validatedDeclarationsscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/checker`/options#validatedDeclarations. = env.validatedDeclarationsscip-go gomod github.com/google/cel-go . `github.com/google/cel-go/checker`/Env#validatedDeclarations().()
40 return nil
41 }
42 }