token.go: new member function Token.SetSymbol()
This commit is contained in:
parent
d25bd325b7
commit
6268abda8c
4
token.go
4
token.go
@ -79,6 +79,10 @@ func (tk *Token) IsSymbol(sym Symbol) bool {
|
||||
return tk.Sym == sym
|
||||
}
|
||||
|
||||
func (tk *Token) SetSymbol(sym Symbol) {
|
||||
tk.Sym = sym
|
||||
}
|
||||
|
||||
func (tk *Token) Errorf(template string, args ...any) (err error) {
|
||||
err = fmt.Errorf(fmt.Sprintf("[%d:%d] ", tk.row, tk.col)+template, args...)
|
||||
return
|
||||
|
Loading…
Reference in New Issue
Block a user