feat: allow trailing comma in map literal by checking right brace in parser
Add a check in the map parsing function to break when encountering a closing brace after a comma, enabling trailing commas in map literals. Include a test case verifying that maps with trailing commas parse and execute correctly.
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
var map = {
|
||||
"a": 1,
|
||||
"b": 2,
|
||||
}
|
||||
|
||||
IO.print(map["a"]) // expect: 1
|
||||
IO.print(map["b"]) // expect: 2
|
||||
Reference in New Issue
Block a user