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