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

Method parseYAML

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

Source from the content-addressed store, hash-verified

552}
553
554func (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
566func sourceToYAML(src *Source, docNode *yaml.Node) error {
567 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