fix token endPos

This commit is contained in:
z7zmey 2018-01-06 15:04:34 +02:00
parent 065e6ad203
commit f58537742d

View File

@ -106,7 +106,9 @@ func (l *lexer) handleNewLine(tokenBytes []byte) ([]byte, int, int, int, int) {
l.lineNumber++
}
return tokenBytes, startln, l.lineNumber, int(l.First.Pos()), int(l.Prev.Pos())
startPos := int(l.First.Pos())
endPos := startPos + len(tokenBytes) - 1
return tokenBytes, startln, l.lineNumber, startPos, endPos
}
func (l *lexer) newToken() t.Token {