Retoor software development Projects Research SearchXNG
Register Sign In

28 lines
346 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
// Allow after '{', ':', and ',', and before ']'.
var map = {
"a":
"a value",
"b": "b value"
}
IO.print(map["a"]) // expect: a value
IO.print(map["b"]) // expect: b value
// Newline after trailing comma.
map = {"c": "c value",
}
IO.print(map["c"]) // expect: c value
// Newline in empty map.
map = {
}
IO.print(map.count) // expect: 0
Reference in New Issue Copy Permalink
f12581a674
wren/test/language/map/newlines.wren
Response time: 34ms
Mail Licenses API