fix: add list newline handling and resolve multiple test TODOs across compiler and test suite

- Add TOKEN_LINE matching after list elements in compiler to allow newlines before commas or closing brackets
- Add tests for list newline handling, EOF after comma/element, and class name inside body
- Remove resolved TODOs for default constructors, inherited fields, metaclass is checks, zero comparison, and bitwise not behavior
This commit is contained in:
Bob Nystrom
2013-12-20 20:42:11 +00:00
parent 46f53e4421
commit d9255666f4
12 changed files with 54 additions and 15 deletions
-4
View File
@@ -1,7 +1,3 @@
io.write([].count) // expect: 0
io.write([1].count) // expect: 1
io.write([1, 2, 3, 4].count) // expect: 4
// TODO: Literal syntax, including newline handling.
// TODO: Unterminated list literal.
// TODO: Subscript operator.
+2
View File
@@ -0,0 +1,2 @@
[1, 2,
// expect error
+2
View File
@@ -0,0 +1,2 @@
[1, 2
// expect error
+14
View File
@@ -0,0 +1,14 @@
// Allow newlines in most places.
var list = [
"a"
, "b",
"c", "d"
]
io.write(list[0]) // expect: a
io.write(list[1]) // expect: b
io.write(list[2]) // expect: c
io.write(list[3]) // expect: d