Compare commits

..

1 Commits

Author SHA1 Message Date
Shadowfacts 6e4cbfdb6d
Add rudimentary JavaScript highlighting to query text view 2020-04-03 00:27:55 -04:00
1 changed files with 5 additions and 2 deletions

View File

@ -231,9 +231,12 @@ class JavaScriptHighlighter {
} }
private func consumeObjectKey() { private func consumeObjectKey() {
guard let char = peek() else { return }
let keyStart = currentIndex! let keyStart = currentIndex!
while let char = peek(), identifiers.contains(char) { if identifierStarts.contains(char) {
consume() consumeIdentifier()
} else if char == "'" || char == "\"" {
consumeString()
} }
print("Object key: '\(text[keyStart..<currentIndex])'") print("Object key: '\(text[keyStart..<currentIndex])'")
} }