示例#1
0
文件: line.go 项目: 8l/leaf
func (g *Gen) synError(pos *tok.Token, op string) {
	e := comperr.New(pos, fmt.Errorf("syntax error for %s", op))
	g.errors = append(g.errors, e)
}
示例#2
0
文件: util.go 项目: 8l/leaf
// err appends an error onto the error list
func (p *Parser) err(s string) {
	e := comperr.New(p.cur(), errors.New(s))
	p.errors = append(p.errors, e)
}
示例#3
0
文件: gen.go 项目: 8l/leaf
func (self *Gen) errorf(t *tok.Token, f string, args ...interface{}) {
	e := comperr.New(t, fmt.Errorf(f, args...))
	self.errors = append(self.errors, e)
}