Debian Codegraph @

selector/parser/error.go

raw symbols SCIP
1 package parser
2
3 import (
4 "fmt"
5
6 "github.com/tomwright/dasel/v3/selector/lexer"
7 )
8
9 type PositionalError struct {
10 Position int
11 Err error
12 }
13
14 func (e *PositionalError) Error() string {
15 return fmt.Sprintf("%v. Position %d.", e.Err, e.Position)
16 }
17
18 type UnexpectedTokenError struct {
19 Token lexer.Token
20 }
21
22 func (e *UnexpectedTokenError) Error() string {
23 return fmt.Sprintf("failed to parse: unexpected token %v %q at position %d.", e.Token.Kind, e.Token.Value, e.Token.Pos)
24 }