ParseVariable will parse the current yaml node as though it is the entry point to a variable.
(ctx ParserContext, policy *Policy, node *yaml.Node)
| 844 | |
| 845 | // ParseVariable will parse the current yaml node as though it is the entry point to a variable. |
| 846 | func (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 | |
| 857 | func (p *parserImpl) parseVariableInline(ctx ParserContext, _ *Policy, v *Variable, node *yaml.Node) *Variable { |
| 858 | iterations := 0 |
no test coverage detected