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
|
// Passes an item back to the client
|
||||||
func (l *Lexer) emit(t Token) {
|
func (l *Lexer) emit(t Token) {
|
||||||
|
// Single-character tokens never backup
|
||||||
|
if len(l.val()) == 1 {
|
||||||
|
l.startCol++
|
||||||
|
}
|
||||||
l.items <- Item{
|
l.items <- Item{
|
||||||
Token: t,
|
Token: t,
|
||||||
Val: l.val(),
|
Val: l.val(),
|
||||||
|
|
Loading…
Reference in New Issue