parser: introduce NewError() to create lexer.Error using lexer.Position
Signed-off-by: Alejandro Mery <amery@jpi.io>
This commit is contained in:
+1
-7
@@ -31,13 +31,7 @@ func defaultOnToken(pos lexer.Position, typ TokenType, value string) error {
|
||||
func defaultOnError(pos lexer.Position, content string, err error) error {
|
||||
log.Printf("%s:%v:%v: %q: %s", "error", pos.Line, pos.Column, content, err)
|
||||
|
||||
return lexer.Error{
|
||||
Line: pos.Line,
|
||||
Column: pos.Column,
|
||||
|
||||
Content: content,
|
||||
Err: err,
|
||||
}
|
||||
return NewError(pos, content, "", err)
|
||||
}
|
||||
|
||||
func (p *Parser) setDefaults() {
|
||||
|
||||
Reference in New Issue
Block a user