1
0
forked from Mirror/wren

allow newline before dot for subscript as well, and add to tests

This commit is contained in:
ruby0x1
2020-09-19 22:03:16 -07:00
parent 4c496c56a6
commit 3c475f01ee
2 changed files with 84 additions and 45 deletions

View File

@ -2378,6 +2378,8 @@ static void subscript(Compiler* compiler, bool canAssign)
finishArgumentList(compiler, &signature);
consume(compiler, TOKEN_RIGHT_BRACKET, "Expect ']' after arguments.");
allowLineBeforeDot(compiler);
if (canAssign && match(compiler, TOKEN_EQ))
{
signature.type = SIG_SUBSCRIPT_SETTER;