Retoor software development Projects Research SearchXNG
Register Sign In

5 lines
86 B
Plaintext
Raw Normal View History

refactor: restructure list/map compilation loops and extract syntax error tests - Convert list() and map() compiler functions from if/do-while to do-while loops - Remove redundant empty literal handling by breaking on right bracket/brace - Add new test files for duplicate comma, duplicate trailing comma, and empty list/map with comma - Expand newlines test to cover trailing comma and empty list/map cases - Simplify trailing_comma tests by removing inline syntax error checks - Update Test.fail() to handle variable arguments without kwargs
2015-08-31 16:23:36 +02:00
var list = ["a", "b",]
feat: allow trailing comma in list literal by early break on right bracket Add support for trailing commas in list literals by checking for TOKEN_RIGHT_BRACKET after parsing the last element in the list() function. When a trailing comma is followed by the closing bracket, the loop breaks immediately instead of attempting to parse another element. Include a test case verifying that lists with trailing commas parse correctly and elements are accessible by index.
2015-05-30 22:18:37 +02:00
IO.print(list[0]) // expect: a
IO.print(list[1]) // expect: b
Reference in New Issue Copy Permalink
f12581a674
wren/test/language/list/trailing_comma.wren
Response time: 51ms
Mail Licenses API