@@ -105,7 +105,7 @@ object Parsers {
105
105
private val InCase : Region => Region = Scanners .InCase (_)
106
106
private val InCond : Region => Region = Scanners .InParens (LPAREN , _)
107
107
private val InFor : Region => Region = Scanners .InBraces (_)
108
- private val InBrk : Region => Region = _. match
108
+ private val InBrk : Region => Region =
109
109
case p : Scanners .InParens => Scanners .Indented (p.indentWidth, p.prefix, p)
110
110
case r => r
111
111
@@ -2328,27 +2328,25 @@ object Parsers {
2328
2328
def condExpr (altToken : Token ): Tree =
2329
2329
val t : Tree =
2330
2330
if in.token == LPAREN then
2331
- var t : Tree =
2332
- inSepRegion( InBrk ) : // allow inferred NEWLINE for observeIndented below
2333
- atSpan(in.offset) :
2334
- makeTupleOrParens(inParensWithCommas(commaSeparated(exprInParens)))
2335
- if in.token != altToken then
2336
- if toBeContinued(altToken) then
2337
- t = inSepRegion(InCond ) {
2331
+ inSepRegion( InBrk ) : // allow inferred NEWLINE for observeIndented below
2332
+ atSpan(in.offset) :
2333
+ makeTupleOrParens(inParensWithCommas(commaSeparated(exprInParens)))
2334
+ .pipe : t =>
2335
+ if in.token == altToken then t
2336
+ else if toBeContinued(altToken) then
2337
+ inSepRegion(InCond ):
2338
2338
expr1Rest(
2339
2339
postfixExprRest(
2340
2340
simpleExprRest(t, Location .ElseWhere ),
2341
2341
Location .ElseWhere ),
2342
2342
Location .ElseWhere )
2343
- }
2344
2343
else
2345
2344
if rewriteToNewSyntax(t.span) then
2346
- dropParensOrBraces(t.span.start, s " ${ tokenString(altToken)} " )
2345
+ dropParensOrBraces(t.span.start, tokenString(altToken))
2347
2346
in.observeIndented()
2348
2347
return t
2349
- t
2350
2348
else if in.isNestedStart then
2351
- try expr() finally newLinesOpt()
2349
+ expr().tap(_ => newLinesOpt() )
2352
2350
else
2353
2351
inSepRegion(InCond )(expr())
2354
2352
if rewriteToOldSyntax(t.span.startPos) then revertToParens(t)
0 commit comments