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() {
guard let char = peek() else { return }
let keyStart = currentIndex!
if identifierStarts.contains(char) {
consumeIdentifier()
} else if char == "'" || char == "\"" {
consumeString()
while let char = peek(), identifiers.contains(char) {
consume()
}
print("Object key: '\(text[keyStart..<currentIndex])'")
}