Example #1
0
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...))
}
Example #2
0
// 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), "error",
		ec.text, int(p), format, args...))
}
Example #3
0
// 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...))
}