@@ -198,12 +198,11 @@ object Parsers {
198198 in.token match {
199199 case USCORE => true
200200 case IDENTIFIER | BACKQUOTED_IDENT =>
201- val nxt = in.lookahead.token
202- nxt == ARROW || nxt == CTXARROW
201+ in.lookahead.isArrow
203202 case LPAREN =>
204203 val lookahead = in.LookaheadScanner ()
205204 lookahead.skipParens()
206- lookahead.token == ARROW || lookahead.token == CTXARROW
205+ lookahead.isArrow
207206 case _ => false
208207 }
209208 } && ! in.isSoftModifierInModifierPosition
@@ -1392,7 +1391,7 @@ object Parsers {
13921391 funArgTypesRest(t, funArgType)
13931392 }
13941393 accept(RPAREN )
1395- if isValParamList || in.token == ARROW || in.token == CTXARROW then
1394+ if isValParamList || in.isArrow then
13961395 functionRest(ts)
13971396 else {
13981397 val ts1 =
@@ -1881,15 +1880,13 @@ object Parsers {
18811880 finally placeholderParams = saved
18821881
18831882 val t = expr1(location)
1884- if ( in.token == ARROW || in.token == CTXARROW ) {
1883+ if in.isArrow then
18851884 placeholderParams = Nil // don't interpret `_' to the left of `=>` as placeholder
18861885 val paramMods = if in.token == CTXARROW then Modifiers (Given ) else EmptyModifiers
18871886 wrapPlaceholders(closureRest(start, location, convertToParams(t, paramMods)))
1888- }
1889- else if (isWildcard(t)) {
1887+ else if isWildcard(t) then
18901888 placeholderParams = placeholderParams ::: saved
18911889 t
1892- }
18931890 else wrapPlaceholders(t)
18941891 }
18951892 }
@@ -2262,7 +2259,8 @@ object Parsers {
22622259 val app = atSpan(startOffset(t), in.offset) { mkApply(t, argumentExprs()) }
22632260 simpleExprRest(app, canApply = true )
22642261 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 )) }
22662264 case _ =>
22672265 t
22682266 }
0 commit comments