xgo/parser/error.go

17 lines
247 B
Go
Raw Normal View History

2019-01-09 10:17:42 +03:00
package parser
import "github.com/d5/tengo/scanner"
type Error struct {
Pos scanner.FilePos
Msg string
}
func (e Error) Error() string {
if e.Pos.Filename != "" || e.Pos.IsValid() {
return e.Pos.String() + ": " + e.Msg
}
return e.Msg
}