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

Method parseVariables

policy/parser.go:782–791  ·  view source on GitHub ↗
(ctx ParserContext, policy *Policy, r *Rule, node *yaml.Node)

Source from the content-addressed store, hash-verified

780}
781
782func (p *parserImpl) parseVariables(ctx ParserContext, policy *Policy, r *Rule, node *yaml.Node) {
783 id := ctx.CollectMetadata(node)
784 if p.assertYAMLType(id, node, yamlList) == nil {
785 return
786 }
787 p.RangeList(node, func(i int, val *yaml.Node) bool {
788 r.AddVariable(p.ParseVariable(ctx, policy, val))
789 return true
790 })
791}
792
793// ParseVariable will parse the current yaml node as though it is the entry point to a variable.
794func (p *parserImpl) ParseVariable(ctx ParserContext, policy *Policy, node *yaml.Node) *Variable {

Callers 1

ParseRuleMethod · 0.95

Calls 5

assertYAMLTypeMethod · 0.95
ParseVariableMethod · 0.95
RangeListMethod · 0.80
AddVariableMethod · 0.80
CollectMetadataMethod · 0.65

Tested by

no test coverage detected