// errorf stops the evaluator. Its panic is supposed to be caught by recover. func (ev *Evaluator) errorf(format string, args ...interface{}) { if n := len(ev.nodes); n > 0 { ev.errorfNode(ev.nodes[n-1], format, args...) } else { util.Panic(fmt.Errorf(format, args...)) } }
// errorf formats the error and terminates processing. func (p *Parser) errorf(pos int, format string, args ...interface{}) { p.Root = nil util.Panic(util.NewContextualError(p.Name, p.text, pos, format, args...)) }
func (cp *Compiler) errorf(n parse.Node, format string, args ...interface{}) { util.Panic(util.NewContextualError(cp.name, cp.text, int(n.Position()), format, args...)) }
func (ev *Evaluator) errorfNode(n parse.Node, format string, args ...interface{}) { util.Panic(util.NewContextualError(ev.name, ev.text, int(n.Position()), format, args...)) }
func (rd *Reader) badEscSeq(msg string) { util.Panic(newBadEscSeq(rd.currentSeq, msg)) }