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

Method parseVariables

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

Source from the content-addressed store, hash-verified

832}
833
834func (p *parserImpl) parseVariables(ctx ParserContext, policy *Policy, r *Rule, node *yaml.Node) {
835 id := ctx.CollectMetadata(node)
836 if p.assertYAMLType(id, node, yamlList) == nil {
837 return
838 }
839 p.RangeList(node, func(i int, val *yaml.Node) bool {
840 r.AddVariable(p.ParseVariable(ctx, policy, val))
841 return true
842 })
843}
844
845// ParseVariable will parse the current yaml node as though it is the entry point to a variable.
846func (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