1
0
Fork 0

Single-character tokens start col fix

This commit is contained in:
Gregory Eremin 2015-02-18 00:49:28 +07:00
parent 3d17f23e65
commit 4917b570b0
1 changed files with 4 additions and 0 deletions

View File

@ -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(),