@@ -2204,7 +2204,7 @@ object Parsers {
2204
2204
* | SimpleExpr `.` MatchClause
2205
2205
* | SimpleExpr (TypeArgs | NamedTypeArgs)
2206
2206
* | SimpleExpr1 ArgumentExprs
2207
- * | SimpleExpr1 :<<< BlockExpr >>> -- under language.experimental.fewerBraces
2207
+ * | SimpleExpr1 :<<< (CaseClauses | Block) >>> -- under language.experimental.fewerBraces
2208
2208
* | SimpleExpr1 FunParams (‘=>’ | ‘?=>’) indent Block outdent -- under language.experimental.fewerBraces
2209
2209
* Quoted ::= ‘'’ ‘{’ Block ‘}’
2210
2210
* | ‘'’ ‘[’ Type ‘]’
@@ -2265,11 +2265,10 @@ object Parsers {
2265
2265
case LBRACKET =>
2266
2266
val tapp = atSpan(startOffset(t), in.offset) { TypeApply (t, typeArgs(namedOK = true , wildOK = false )) }
2267
2267
simpleExprRest(tapp, location, canApply = true )
2268
- case LPAREN | LBRACE | INDENT if canApply =>
2269
- val inParents = in.token == LPAREN
2268
+ case LPAREN if canApply =>
2270
2269
val app = atSpan(startOffset(t), in.offset) {
2271
2270
val argExprs @ (args, isUsing) = argumentExprs()
2272
- if inParents && ! isUsing && in.isArrow && location != Location .InGuard then
2271
+ if ! isUsing && in.isArrow && location != Location .InGuard && in.fewerBracesEnabled then
2273
2272
val params = convertToParams(Tuple (args))
2274
2273
if params.forall(_.name != nme.ERROR ) then
2275
2274
applyToClosure(t, in.offset, params)
@@ -2279,13 +2278,17 @@ object Parsers {
2279
2278
mkApply(t, argExprs)
2280
2279
}
2281
2280
simpleExprRest(app, location, canApply = true )
2281
+ case LBRACE | INDENT if canApply =>
2282
+ val app = atSpan(startOffset(t), in.offset) { mkApply(t, argumentExprs()) }
2283
+ simpleExprRest(app, location, canApply = true )
2282
2284
case USCORE =>
2283
- if in.lookahead.isArrow && location != Location .InGuard then
2285
+ if in.lookahead.isArrow && location != Location .InGuard && in.fewerBracesEnabled then
2284
2286
val app = applyToClosure(t, in.offset, convertToParams(wildcardIdent()))
2285
2287
simpleExprRest(app, location, canApply = true )
2286
2288
else
2287
2289
atSpan(startOffset(t), in.skipToken()) { PostfixOp (t, Ident (nme.WILDCARD )) }
2288
- case IDENTIFIER if ! in.isOperator && in.lookahead.isArrow && location != Location .InGuard =>
2290
+ case IDENTIFIER
2291
+ if ! in.isOperator && in.lookahead.isArrow && location != Location .InGuard && in.fewerBracesEnabled =>
2289
2292
val app = applyToClosure(t, in.offset, convertToParams(termIdent()))
2290
2293
simpleExprRest(app, location, canApply = true )
2291
2294
case _ =>
0 commit comments