@@ -198,12 +198,11 @@ object Parsers {
198
198
in.token match {
199
199
case USCORE => true
200
200
case IDENTIFIER | BACKQUOTED_IDENT =>
201
- val nxt = in.lookahead.token
202
- nxt == ARROW || nxt == CTXARROW
201
+ in.lookahead.isArrow
203
202
case LPAREN =>
204
203
val lookahead = in.LookaheadScanner ()
205
204
lookahead.skipParens()
206
- lookahead.token == ARROW || lookahead.token == CTXARROW
205
+ lookahead.isArrow
207
206
case _ => false
208
207
}
209
208
} && ! in.isSoftModifierInModifierPosition
@@ -1392,7 +1391,7 @@ object Parsers {
1392
1391
funArgTypesRest(t, funArgType)
1393
1392
}
1394
1393
accept(RPAREN )
1395
- if isValParamList || in.token == ARROW || in.token == CTXARROW then
1394
+ if isValParamList || in.isArrow then
1396
1395
functionRest(ts)
1397
1396
else {
1398
1397
val ts1 =
@@ -1881,15 +1880,13 @@ object Parsers {
1881
1880
finally placeholderParams = saved
1882
1881
1883
1882
val t = expr1(location)
1884
- if ( in.token == ARROW || in.token == CTXARROW ) {
1883
+ if in.isArrow then
1885
1884
placeholderParams = Nil // don't interpret `_' to the left of `=>` as placeholder
1886
1885
val paramMods = if in.token == CTXARROW then Modifiers (Given ) else EmptyModifiers
1887
1886
wrapPlaceholders(closureRest(start, location, convertToParams(t, paramMods)))
1888
- }
1889
- else if (isWildcard(t)) {
1887
+ else if isWildcard(t) then
1890
1888
placeholderParams = placeholderParams ::: saved
1891
1889
t
1892
- }
1893
1890
else wrapPlaceholders(t)
1894
1891
}
1895
1892
}
@@ -2262,7 +2259,8 @@ object Parsers {
2262
2259
val app = atSpan(startOffset(t), in.offset) { mkApply(t, argumentExprs()) }
2263
2260
simpleExprRest(app, canApply = true )
2264
2261
case USCORE =>
2265
- atSpan(startOffset(t), in.skipToken()) { PostfixOp (t, Ident (nme.WILDCARD )) }
2262
+ if in.lookahead.isArrow then ???
2263
+ else atSpan(startOffset(t), in.skipToken()) { PostfixOp (t, Ident (nme.WILDCARD )) }
2266
2264
case _ =>
2267
2265
t
2268
2266
}
0 commit comments