xgo/compiler/parser/error.go
Daniel Kang b79fd4f7ef
Fix lint issues (#2)
* addressing golint issues

* fix all lint issues.
2019-01-14 22:24:33 -08:00

17 lines
290 B
Go

package parser
import "github.com/d5/tengo/compiler/source"
// Error represents a parser error.
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
}