@@ -97,7 +97,7 @@ object Parsers {
97
97
private val InCase : Region => Region = Scanners .InCase (_)
98
98
private val InCond : Region => Region = Scanners .InParens (LPAREN , _)
99
99
private val InFor : Region => Region = Scanners .InBraces (_)
100
- private val InBrk : Region => Region = _. match
100
+ private val InBrk : Region => Region =
101
101
case p : Scanners .InParens => Scanners .Indented (p.indentWidth, p.prefix, p)
102
102
case r => r
103
103
@@ -2132,27 +2132,25 @@ object Parsers {
2132
2132
def condExpr (altToken : Token ): Tree =
2133
2133
val t : Tree =
2134
2134
if in.token == LPAREN then
2135
- var t : Tree =
2136
- inSepRegion( InBrk ) : // allow inferred NEWLINE for observeIndented below
2137
- atSpan(in.offset) :
2138
- makeTupleOrParens(inParensWithCommas(commaSeparated(exprInParens)))
2139
- if in.token != altToken then
2140
- if toBeContinued(altToken) then
2141
- t = inSepRegion(InCond ) {
2135
+ inSepRegion( InBrk ) : // allow inferred NEWLINE for observeIndented below
2136
+ atSpan(in.offset) :
2137
+ makeTupleOrParens(inParensWithCommas(commaSeparated(exprInParens)))
2138
+ .pipe : t =>
2139
+ if in.token == altToken then t
2140
+ else if toBeContinued(altToken) then
2141
+ inSepRegion(InCond ):
2142
2142
expr1Rest(
2143
2143
postfixExprRest(
2144
2144
simpleExprRest(t, Location .ElseWhere ),
2145
2145
Location .ElseWhere ),
2146
2146
Location .ElseWhere )
2147
- }
2148
2147
else
2149
2148
if rewriteToNewSyntax(t.span) then
2150
- dropParensOrBraces(t.span.start, s " ${ tokenString(altToken)} " )
2149
+ dropParensOrBraces(t.span.start, tokenString(altToken))
2151
2150
in.observeIndented()
2152
2151
return t
2153
- t
2154
2152
else if in.isNestedStart then
2155
- try expr() finally newLinesOpt()
2153
+ expr().tap(_ => newLinesOpt() )
2156
2154
else
2157
2155
inSepRegion(InCond )(expr())
2158
2156
if rewriteToOldSyntax(t.span.startPos) then revertToParens(t)
0 commit comments