MCPcopy
hub / github.com/go-yaml/yaml / fail

Method fail

decode.go:112–138  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

110}
111
112func (p *parser) fail() {
113 var where string
114 var line int
115 if p.parser.context_mark.line != 0 {
116 line = p.parser.context_mark.line
117 // Scanner errors don't iterate line before returning error
118 if p.parser.error == yaml_SCANNER_ERROR {
119 line++
120 }
121 } else if p.parser.problem_mark.line != 0 {
122 line = p.parser.problem_mark.line
123 // Scanner errors don't iterate line before returning error
124 if p.parser.error == yaml_SCANNER_ERROR {
125 line++
126 }
127 }
128 if line != 0 {
129 where = "line " + strconv.Itoa(line) + ": "
130 }
131 var msg string
132 if len(p.parser.problem) > 0 {
133 msg = p.parser.problem
134 } else {
135 msg = "unknown problem parsing YAML content"
136 }
137 failf("%s%s", where, msg)
138}
139
140func (p *parser) anchor(n *Node, anchor []byte) {
141 if anchor != nil {

Callers 2

expectMethod · 0.95
peekMethod · 0.95

Calls 1

failfFunction · 0.85

Tested by

no test coverage detected