Single-character tokens start col fix
This commit is contained in:
parent
3d17f23e65
commit
4917b570b0
|
@ -144,6 +144,10 @@ func (l *Lexer) ignore() {
|
|||
|
||||
// Passes an item back to the client
|
||||
func (l *Lexer) emit(t Token) {
|
||||
// Single-character tokens never backup
|
||||
if len(l.val()) == 1 {
|
||||
l.startCol++
|
||||
}
|
||||
l.items <- Item{
|
||||
Token: t,
|
||||
Val: l.val(),
|
||||
|
|
Loading…
Reference in New Issue