JavaScript Highlighter: Fix array whitespace
This commit is contained in:
parent
a976cf894f
commit
1b0d261d54
|
@ -289,7 +289,7 @@ class JavaScriptHighlighter {
|
||||||
indent += " "
|
indent += " "
|
||||||
array:
|
array:
|
||||||
while currentIndex < text.endIndex && peek() != "]" {
|
while currentIndex < text.endIndex && peek() != "]" {
|
||||||
print("Array element")
|
consumeWhitespace()
|
||||||
while currentIndex < text.endIndex {
|
while currentIndex < text.endIndex {
|
||||||
if peek() == "," {
|
if peek() == "," {
|
||||||
consume() // ,
|
consume() // ,
|
||||||
|
@ -300,6 +300,7 @@ class JavaScriptHighlighter {
|
||||||
break array
|
break array
|
||||||
} else {
|
} else {
|
||||||
indent += " "
|
indent += " "
|
||||||
|
print("Array element")
|
||||||
consumeExpression()
|
consumeExpression()
|
||||||
indent = String(indent.dropLast(2))
|
indent = String(indent.dropLast(2))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue