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

Function mustNewParser

parser/parser.go:83–89  ·  view source on GitHub ↗

mustNewParser does the work of NewParser and panics if an error occurs. This function is only intended for internal use and is for backwards compatibility in Parse and ParseWithMacros, where we know the options will result in an error.

(opts ...Option)

Source from the content-addressed store, hash-verified

81// This function is only intended for internal use and is for backwards compatibility in Parse and
82// ParseWithMacros, where we know the options will result in an error.
83func mustNewParser(opts ...Option) *Parser {
84 p, err := NewParser(opts...)
85 if err != nil {
86 panic(err)
87 }
88 return p
89}
90
91// Parse parses the expression represented by source and returns the result.
92func (p *Parser) Parse(source common.Source) (*ast.AST, *common.Errors) {

Callers 1

ParseFunction · 0.85

Calls 1

NewParserFunction · 0.70

Tested by

no test coverage detected