Update token string func.
This commit is contained in:
parent
574794507e
commit
d2362be35b
15
lexer.go
15
lexer.go
@ -55,7 +55,20 @@ func (t *Token) Equals(other *Token) bool {
|
||||
|
||||
// String formats the token in a human readable form.
|
||||
func (t *Token) String() string {
|
||||
return fmt.Sprintf("%d %q %d (%d, %d)-(%d, %d)", t.Type, t.Value, t.TC, t.StartLine, t.StartColumn, t.EndLine, t.EndColumn)
|
||||
return fmt.Sprintf(
|
||||
"%d %q %d (%d, %d)-(%d, %d) (%d, %d)-(%d, %d)",
|
||||
t.Type,
|
||||
t.Value,
|
||||
t.TC,
|
||||
t.StartLine,
|
||||
t.StartColumn,
|
||||
t.EndLine,
|
||||
t.EndColumn,
|
||||
t.TSLine,
|
||||
t.TSColumn,
|
||||
t.TELine,
|
||||
t.TEColumn,
|
||||
)
|
||||
}
|
||||
|
||||
// An Action is a function which get called when the Scanner finds a match
|
||||
|
Loading…
Reference in New Issue
Block a user