MCPcopy Create free account
hub / github.com/cel-expr/cel-go / NewParser

Function NewParser

policy/parser.go:514–524  ·  view source on GitHub ↗

NewParser creates a new Parser object with a set of functional options.

(opts ...ParserOption)

Source from the content-addressed store, hash-verified

512
513// NewParser creates a new Parser object with a set of functional options.
514func NewParser(opts ...ParserOption) (*Parser, error) {
515 p := &Parser{TagVisitor: defaultTagVisitor{}}
516 var err error
517 for _, o := range opts {
518 p, err = o(p)
519 if err != nil {
520 return nil, err
521 }
522 }
523 return p, nil
524}
525
526// Parse generates an internal parsed policy representation from a YAML input file.
527// The internal representation ensures that CEL expressions are tracked relative to

Callers 9

CreatePolicyParserMethod · 0.92
TestParseFunction · 0.70
TestParseErrorFunction · 0.70
TestCustomTagVisitorFunction · 0.70
TestSimpleVariablesFunction · 0.70
TestCompose_SourceInfoFunction · 0.70
TestCompose_UnnestFunction · 0.70
parsePolicyFunction · 0.70

Calls

no outgoing calls

Tested by 8

TestParseFunction · 0.56
TestParseErrorFunction · 0.56
TestCustomTagVisitorFunction · 0.56
TestSimpleVariablesFunction · 0.56
TestCompose_SourceInfoFunction · 0.56
TestCompose_UnnestFunction · 0.56
parsePolicyFunction · 0.56