Compare commits

..

1 Commits

Author SHA1 Message Date
Shadowfacts 56efc109d7
Add rudimentary JavaScript highlighting to query text view 2020-04-02 23:06:45 -04:00
1 changed files with 2 additions and 5 deletions

View File

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