feat: add user-defined subscript operators with bracket parameter lists

Refactor parameter list parsing to support bracket-delimited parameters for
subscript operators. Extract finishParameterList from parameterList to handle
the common closing logic, and add TOKEN_RIGHT_BRACKET case for error messages.
Add comprehensive test suite for subscript getters and setters with 1-3
parameters in test/method/subscript_operators.wren.
This commit is contained in:
Bob Nystrom
2015-01-21 02:25:54 +00:00
parent 895f52c77b
commit a4baa42d6f
3 changed files with 78 additions and 30 deletions
-2
View File
@@ -21,5 +21,3 @@
list[-3] = 7
IO.print(list) // expect: [7, 6, 5]
}
// TODO: Not in this dir, but need tests for subscript setter grammar.