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