@@ -983,9 +983,15 @@ object Parsers {
983
983
}
984
984
else
985
985
val t = reduceStack(base, top, minPrec, leftAssoc = true , in.name, isType)
986
- if ! isType && in.token == MATCH then recur (matchClause(t))
986
+ if ! isType && in.token == MATCH then recurAtMinPrec (matchClause(t))
987
987
else t
988
988
989
+ def recurAtMinPrec (top : Tree ): Tree =
990
+ if isIdent && isOperator && precedence(in.name) == minInfixPrec
991
+ || in.token == MATCH
992
+ then recur(top)
993
+ else top
994
+
989
995
recur(first)
990
996
}
991
997
@@ -2758,8 +2764,8 @@ object Parsers {
2758
2764
/** OLD: GivenTypes ::= AnnotType {‘,’ AnnotType}
2759
2765
* NEW: GivenTypes ::= Type {‘,’ Type}
2760
2766
*/
2761
- def givenTypes (newStyle : Boolean , nparams : Int , ofClass : Boolean ): List [ValDef ] =
2762
- val tps = commaSeparated(() => if newStyle then typ() else annotType() )
2767
+ def givenTypes (nparams : Int , ofClass : Boolean ): List [ValDef ] =
2768
+ val tps = commaSeparated(typ)
2763
2769
var counter = nparams
2764
2770
def nextIdx = { counter += 1 ; counter }
2765
2771
val paramFlags = if ofClass then Private | Local | ParamAccessor else Param
@@ -2862,7 +2868,7 @@ object Parsers {
2862
2868
|| startParamTokens.contains(in.token)
2863
2869
|| isIdent && (in.name == nme.inline || in.lookaheadIn(BitSet (COLON )))
2864
2870
if isParams then commaSeparated(() => param())
2865
- else givenTypes(true , nparams, ofClass)
2871
+ else givenTypes(nparams, ofClass)
2866
2872
checkVarArgsRules(clause)
2867
2873
clause
2868
2874
}
@@ -3477,12 +3483,11 @@ object Parsers {
3477
3483
val t = constrApp()
3478
3484
val ts =
3479
3485
if in.token == WITH then
3480
- val lookahead = in.LookaheadScanner (indent = true )
3481
- lookahead.nextToken( )
3482
- if templateCanFollow && (lookahead .token == LBRACE || lookahead .token == INDENT ) then
3486
+ in.nextToken( )
3487
+ newLineOptWhenFollowedBy( LBRACE )
3488
+ if templateCanFollow && (in .token == LBRACE || in .token == INDENT ) then
3483
3489
Nil
3484
3490
else
3485
- in.nextToken()
3486
3491
checkNotWithAtEOL()
3487
3492
constrApps(commaOK, templateCanFollow)
3488
3493
else if commaOK && in.token == COMMA then
0 commit comments