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

Method ParseVariable

policy/parser.go:846–855  ·  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

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 {
847 v, id := ctx.NewVariable(node)
848 if p.assertYAMLType(id, node, yamlMap) == nil || !p.checkMapValid(ctx, id, node) {
849 return v
850 }
851 if p.inlineStyleVariables {
852 return p.parseVariableInline(ctx, policy, v, node)
853 }
854 return p.parseVariableObject(ctx, policy, v, node)
855}
856
857func (p *parserImpl) parseVariableInline(ctx ParserContext, _ *Policy, v *Variable, node *yaml.Node) *Variable {
858 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