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

Method ParseVariable

policy/parser.go:794–803  ·  view source on GitHub ↗

ParseVariable will parse the current yaml node as though it is the entry point to a variable.

(ctx ParserContext, policy *Policy, node *yaml.Node)

Source from the content-addressed store, hash-verified

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 {
795 v, id := ctx.NewVariable(node)
796 if p.assertYAMLType(id, node, yamlMap) == nil || !p.checkMapValid(ctx, id, node) {
797 return v
798 }
799 if p.inlineStyleVariables {
800 return p.parseVariableInline(ctx, policy, v, node)
801 }
802 return p.parseVariableObject(ctx, policy, v, node)
803}
804
805func (p *parserImpl) parseVariableInline(ctx ParserContext, policy *Policy, v *Variable, node *yaml.Node) *Variable {
806 iterations := 0

Callers 1

parseVariablesMethod · 0.95

Calls 5

assertYAMLTypeMethod · 0.95
checkMapValidMethod · 0.95
parseVariableInlineMethod · 0.95
parseVariableObjectMethod · 0.95
NewVariableMethod · 0.65

Tested by

no test coverage detected