// errorf stops the ec.eval immediately by panicking with a diagnostic message. // The panic is supposed to be caught by ec.eval. func (ec *evalCtx) errorf(p parse.Pos, format string, args ...interface{}) { errutil.Throw(errutil.NewContextualError( fmt.Sprintf("%s (%s)", ec.name, ec.context), "evalling error", ec.text, int(p), format, args...)) }
func throw(e error) { errutil.Throw(e) }
func (cc *compileCtx) errorf(p parse.Pos, format string, args ...interface{}) { errutil.Throw(errutil.NewContextualError(cc.name, "static error", cc.text, int(p), format, args...)) }
func (rd *Reader) badEscSeq(msg string) { errutil.Throw(newBadEscSeq(rd.currentSeq, msg)) }
// errorf formats the error and terminates processing. func (p *Parser) errorf(pos int, format string, args ...interface{}) { p.Root = nil errutil.Throw(errutil.NewContextualError(p.Name, "parsing error", p.text, pos, format, args...)) }