b79fd4f7ef
* addressing golint issues * fix all lint issues.
17 lines
290 B
Go
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
|
|
}
|