Fix a bug where tokens without spaces were parsed incorrectly

This commit is contained in:
David Jennes
2018-09-26 03:06:49 +02:00
parent c7dbba41a5
commit 2e67755118
2 changed files with 13 additions and 5 deletions

View File

@@ -146,7 +146,7 @@ class Scanner {
for (index, char) in content.unicodeScalars.enumerated() {
if foundChar && char == Scanner.tokenEndDelimiter {
let result = String(content.prefix(index))
let result = String(content.prefix(index + 1))
content = String(content.dropFirst(index + 1))
range = range.upperBound..<originalContent.index(range.upperBound, offsetBy: index + 1)
return result