xgo/compiler/parser/error.go

17 lines
254 B
Go
Raw Normal View History

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