asciigoat's INI parser
https://asciigoat.org/ini
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
426 B
22 lines
426 B
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 |
|
}
|
|
|