Compare commits
1 Commits
56efc109d7
...
6e4cbfdb6d
Author | SHA1 | Date |
---|---|---|
Shadowfacts | 6e4cbfdb6d |
|
@ -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])'")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue