Improved error handling
This commit is contained in:
parent
78cde0d0bd
commit
a48f2868fb
7 changed files with 71 additions and 60 deletions
|
@ -11,6 +11,11 @@ type Token struct {
|
|||
Bytes []byte
|
||||
}
|
||||
|
||||
// After returns the position after the token.
|
||||
func (t Token) After() int {
|
||||
return t.Position + len(t.Bytes)
|
||||
}
|
||||
|
||||
// String creates a human readable representation for debugging purposes.
|
||||
func (t Token) String() string {
|
||||
return fmt.Sprintf("%s %s", t.Kind, t.Text())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue