@@ -574,7 +574,7 @@ object Parsers {
574
574
}
575
575
576
576
/** Drop (...) or { ... }, replacing the closing element with `endStr` */
577
- def dropParensOrBraces (start : Offset , endStr : String ) = {
577
+ def dropParensOrBraces (start : Offset , endStr : String ): Unit = {
578
578
patch(source, Span (start, start + 1 ), " " )
579
579
val filler = if (in.lastOffset == in.offset) " " else " "
580
580
val closingStartsLine = testChar(skipBlanks(in.lastOffset - 2 , - 1 ), Chars .LF )
@@ -1356,7 +1356,7 @@ object Parsers {
1356
1356
dropParensOrBraces(t.span.start, s " ${tokenString(altToken)}" )
1357
1357
t
1358
1358
} else {
1359
- val t = expr()
1359
+ val t = inSepRegion( LPAREN , RPAREN )( expr() )
1360
1360
accept(altToken)
1361
1361
if (in.revertCleanRewrite) revertToParens(t)
1362
1362
t
@@ -1992,7 +1992,9 @@ object Parsers {
1992
1992
1993
1993
/* if (in.token == INDENT) inBracesOrIndented(enumerators())
1994
1994
else*/ {
1995
- val ts = enumerators()
1995
+ val ts = // If we use indent syntax, the distinction below should no longer be necessary
1996
+ if (in.isAfterLineEnd()) enumerators()
1997
+ else inSepRegion(LPAREN , RPAREN )(enumerators())
1996
1998
if (in.revertCleanRewrite && ts.nonEmpty) {
1997
1999
patch(source, ts.head.span.startPos, " (" )
1998
2000
patch(source, ts.last.span.endPos, " )" )
0 commit comments