xgo/parser/error.go
2019-01-11 01:16:34 -08:00

16 lines
245 B
Go

package parser
import "github.com/d5/tengo/source"
type Error struct {
Pos source.FilePos
Msg string
}
func (e Error) Error() string {
if e.Pos.Filename != "" || e.Pos.IsValid() {
return e.Pos.String() + ": " + e.Msg
}
return e.Msg
}