package basic import ( "errors" "asciigoat.org/core/lexer" "asciigoat.org/ini/parser" ) var ( errInvalidToken = errors.New("invalid token") ) func newErrInvalidToken(t *token) *lexer.Error { return parser.NewError(t.pos, t.value, "", errInvalidToken) } func (dec *decoder) OnError(pos lexer.Position, content string, err error) error { err = parser.NewError(pos, content, "", err) dec.executeFinal() return err }