mirror of
https://github.com/cwinfo/matterbridge.git
synced 2024-11-10 15:40:30 +00:00
22 lines
359 B
Go
22 lines
359 B
Go
|
package parser
|
||
|
|
||
|
import (
|
||
|
"fmt"
|
||
|
|
||
|
"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 fmt.Sprintf("Parse Error: %s\n\tat %s", e.Msg, e.Pos)
|
||
|
}
|
||
|
|
||
|
return fmt.Sprintf("Parse Error: %s", e.Msg)
|
||
|
}
|