@@ -2204,7 +2204,7 @@ object Parsers {
22042204 * | SimpleExpr `.` MatchClause
22052205 * | SimpleExpr (TypeArgs | NamedTypeArgs)
22062206 * | SimpleExpr1 ArgumentExprs
2207- * | SimpleExpr1 :<<< BlockExpr >>> -- under language.experimental.fewerBraces
2207+ * | SimpleExpr1 :<<< (CaseClauses | Block) >>> -- under language.experimental.fewerBraces
22082208 * | SimpleExpr1 FunParams (‘=>’ | ‘?=>’) indent Block outdent -- under language.experimental.fewerBraces
22092209 * Quoted ::= ‘'’ ‘{’ Block ‘}’
22102210 * | ‘'’ ‘[’ Type ‘]’
@@ -2265,11 +2265,10 @@ object Parsers {
22652265 case LBRACKET =>
22662266 val tapp = atSpan(startOffset(t), in.offset) { TypeApply (t, typeArgs(namedOK = true , wildOK = false )) }
22672267 simpleExprRest(tapp, location, canApply = true )
2268- case LPAREN | LBRACE | INDENT if canApply =>
2269- val inParents = in.token == LPAREN
2268+ case LPAREN if canApply =>
22702269 val app = atSpan(startOffset(t), in.offset) {
22712270 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
22732272 val params = convertToParams(Tuple (args))
22742273 if params.forall(_.name != nme.ERROR ) then
22752274 applyToClosure(t, in.offset, params)
@@ -2279,13 +2278,17 @@ object Parsers {
22792278 mkApply(t, argExprs)
22802279 }
22812280 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 )
22822284 case USCORE =>
2283- if in.lookahead.isArrow && location != Location .InGuard then
2285+ if in.lookahead.isArrow && location != Location .InGuard && in.fewerBracesEnabled then
22842286 val app = applyToClosure(t, in.offset, convertToParams(wildcardIdent()))
22852287 simpleExprRest(app, location, canApply = true )
22862288 else
22872289 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 =>
22892292 val app = applyToClosure(t, in.offset, convertToParams(termIdent()))
22902293 simpleExprRest(app, location, canApply = true )
22912294 case _ =>
0 commit comments