(src *Source)
| 594 | } |
| 595 | |
| 596 | func (p *parserImpl) parseYAML(src *Source) *Policy { |
| 597 | // Parse yaml representation from the source to an object model. |
| 598 | var docNode yaml.Node |
| 599 | err := sourceToYAML(src, &docNode) |
| 600 | if err != nil { |
| 601 | p.iss.ReportErrorAtID(0, "%s", err.Error()) |
| 602 | return nil |
| 603 | } |
| 604 | // Entry point always has a single Content node |
| 605 | return p.ParsePolicy(p, docNode.Content[0]) |
| 606 | } |
| 607 | |
| 608 | func sourceToYAML(src *Source, docNode *yaml.Node) error { |
| 609 | err := yaml.Unmarshal([]byte(src.Content()), docNode) |
no test coverage detected