Merge branch 'dev' of ssh://gitea.xintech.co:2222/zhouzhihong/lexmachine into dev
This commit is contained in:
commit
95e26e7aae
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.
|
// String formats the token in a human readable form.
|
||||||
func (t *Token) String() string {
|
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
|
// An Action is a function which get called when the Scanner finds a match
|
||||||
|
Loading…
Reference in New Issue
Block a user