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

Method parseYAML

policy/parser.go:596–606  ·  view source on GitHub ↗
(src *Source)

Source from the content-addressed store, hash-verified

594}
595
596func (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
608func sourceToYAML(src *Source, docNode *yaml.Node) error {
609 err := yaml.Unmarshal([]byte(src.Content()), docNode)

Callers 1

ParseMethod · 0.80

Calls 4

ParsePolicyMethod · 0.95
sourceToYAMLFunction · 0.85
ReportErrorAtIDMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected