Browse Source

JavaScript Highlighter: Fix array whitespace

master
Shadowfacts 3 months ago
parent
commit
1b0d261d54
Signed by: Shadowfacts <me@shadowfacts.net> GPG Key ID: 94A5AB95422746E5
1 changed files with 2 additions and 1 deletions
  1. 2
    1
      MongoView/Synax Highlighting/JavaScriptHighlighter.swift

+ 2
- 1
MongoView/Synax Highlighting/JavaScriptHighlighter.swift View File

@@ -289,7 +289,7 @@ class JavaScriptHighlighter {
289 289
         indent += "  "
290 290
         array:
291 291
         while currentIndex < text.endIndex && peek() != "]" {
292
-            print("Array element")
292
+            consumeWhitespace()
293 293
             while currentIndex < text.endIndex {
294 294
                 if peek() == "," {
295 295
                     consume() // ,
@@ -300,6 +300,7 @@ class JavaScriptHighlighter {
300 300
                     break array
301 301
                 } else {
302 302
                     indent += "  "
303
+                    print("Array element")
303 304
                     consumeExpression()
304 305
                     indent = String(indent.dropLast(2))
305 306
                 }

Loading…
Cancel
Save