(src *Source)
| 552 | } |
| 553 | |
| 554 | func (p *parserImpl) parseYAML(src *Source) *Policy { |
| 555 | // Parse yaml representation from the source to an object model. |
| 556 | var docNode yaml.Node |
| 557 | err := sourceToYAML(src, &docNode) |
| 558 | if err != nil { |
| 559 | p.iss.ReportErrorAtID(0, "%s", err.Error()) |
| 560 | return nil |
| 561 | } |
| 562 | // Entry point always has a single Content node |
| 563 | return p.ParsePolicy(p, docNode.Content[0]) |
| 564 | } |
| 565 | |
| 566 | func sourceToYAML(src *Source, docNode *yaml.Node) error { |
| 567 | err := yaml.Unmarshal([]byte(src.Content()), docNode) |
no test coverage detected