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

Method Parse

parser/parser.go:88–93  ·  view source on GitHub ↗

Parse parses the expression represented by source and returns the result.

(source common.Source)

Source from the content-addressed store, hash-verified

86
87// Parse parses the expression represented by source and returns the result.
88func (p *Parser) Parse(source common.Source) (*ast.AST, *common.Errors) {
89 if p.enablePrattParser {
90 return (&prattParser{options: p.options}).Parse(source)
91 }
92 return (&antlrParser{options: p.options}).Parse(source)
93}
94
95// reservedIds are not legal to use as variables. We exclude them post-parse, as they *are* valid
96// field names for protos, and it would complicate the grammar to distinguish the cases.

Callers 11

TestSourceInfoPositionsFunction · 0.95
TestPopulateMacroCallsFunction · 0.95
TestErrorRecoveryLimitsFunction · 0.95
TestRecursionLimitFunction · 0.95
BenchmarkParseFunction · 0.95
BenchmarkParseParallelFunction · 0.95
TestExprHelperCopyFunction · 0.95
TestUnparseFunction · 0.95
TestUnparseEscapedCallsFunction · 0.95

Calls 1

ParseMethod · 0.65

Tested by 11

TestSourceInfoPositionsFunction · 0.76
TestPopulateMacroCallsFunction · 0.76
TestErrorRecoveryLimitsFunction · 0.76
TestRecursionLimitFunction · 0.76
BenchmarkParseFunction · 0.76
BenchmarkParseParallelFunction · 0.76
TestExprHelperCopyFunction · 0.76
TestUnparseFunction · 0.76
TestUnparseEscapedCallsFunction · 0.76