Open AndreVanDelft opened 9 years ago
The SLS states, among others:
ArgumentExprs ::= ‘(’ [Exprs] ‘)’
| ‘(’ [Exprs ‘,’] PostfixExpr ‘:’ ‘_’ ‘*’ ’)’
| [nl] BlockExpr
So a new line is optional for a BlockExpr; and this just happens not to be applicable to a number. So scalac has it quite right. However, for SubScript the opening brace should just introduce a code fragment, so we should change the behaviour a little.
Regression:
yields
It appears that scanner correctly inserts a NEWLINE after the
-4
, but methodsimpleExpr()
of the Parser parses this number and then continues withsimpleExprRest(t, canApply = true)
; the latter starts withIt seems that the regular Scala compiler (2.11) has the same code; in a worksheet in Eclipse it gives the same problem. Scala 2.8 online REPL, seems to behave better.
So it seems SubScript is well compatible with the current Scala version. But do we want that?