@@ -311,7 +311,7 @@ object Parsers {
311
311
312
312
def acceptColon (): Int =
313
313
val offset = in.offset
314
- if in.isColon() then { in.nextToken(); offset }
314
+ if in.isColon then { in.nextToken(); offset }
315
315
else accept(COLONop )
316
316
317
317
/** semi = nl {nl} | `;'
@@ -888,7 +888,7 @@ object Parsers {
888
888
lookahead.nextToken()
889
889
skipParams()
890
890
skipParams()
891
- lookahead.isColon()
891
+ lookahead.isColon
892
892
893
893
def followingIsExtension () =
894
894
val next = in.lookahead.token
@@ -1458,7 +1458,7 @@ object Parsers {
1458
1458
val paramStart = in.offset
1459
1459
val ts = in.currentRegion.withCommasExpected {
1460
1460
funArgType() match
1461
- case Ident (name) if name != tpnme.WILDCARD && in.isColon() =>
1461
+ case Ident (name) if name != tpnme.WILDCARD && in.isColon =>
1462
1462
isValParamList = true
1463
1463
commaSeparatedRest(
1464
1464
typedFunParam(paramStart, name.toTermName, imods),
@@ -1876,7 +1876,7 @@ object Parsers {
1876
1876
}
1877
1877
1878
1878
def contextBounds (pname : TypeName ): List [Tree ] =
1879
- if in.isColon() then
1879
+ if in.isColon then
1880
1880
atSpan(in.skipToken()) {
1881
1881
AppliedTypeTree (toplevelTyp(), Ident (pname))
1882
1882
} :: contextBounds(pname)
@@ -1891,7 +1891,7 @@ object Parsers {
1891
1891
Nil
1892
1892
1893
1893
def typedOpt (): Tree =
1894
- if in.isColon() then { in.nextToken(); toplevelTyp() }
1894
+ if in.isColon then { in.nextToken(); toplevelTyp() }
1895
1895
else TypeTree ().withSpan(Span (in.lastOffset))
1896
1896
1897
1897
def typeDependingOn (location : Location ): Tree =
@@ -2119,8 +2119,8 @@ object Parsers {
2119
2119
else expr1Rest(postfixExpr(location), location)
2120
2120
end expr1
2121
2121
2122
- def expr1Rest (t : Tree , location : Location ): Tree = in.token match
2123
- case EQUALS =>
2122
+ def expr1Rest (t : Tree , location : Location ): Tree =
2123
+ if in.token == EQUALS then
2124
2124
t match
2125
2125
case Ident (_) | Select (_, _) | Apply (_, _) | PrefixOp (_, _) =>
2126
2126
atSpan(startOffset(t), in.skipToken()) {
@@ -2129,12 +2129,11 @@ object Parsers {
2129
2129
}
2130
2130
case _ =>
2131
2131
t
2132
- case COLONop | COLONfollow =>
2132
+ else if in.isColon then
2133
2133
in.nextToken()
2134
2134
ascription(t, location)
2135
- case _ =>
2135
+ else
2136
2136
t
2137
- end expr1Rest
2138
2137
2139
2138
def ascription (t : Tree , location : Location ): Tree = atSpan(startOffset(t)) {
2140
2139
in.token match {
@@ -2363,7 +2362,7 @@ object Parsers {
2363
2362
case _ =>
2364
2363
if isLiteral then
2365
2364
literal()
2366
- else if in.isColon() then
2365
+ else if in.isColon then
2367
2366
syntaxError(IllegalStartSimpleExpr (tokenString(in.token)))
2368
2367
in.nextToken()
2369
2368
simpleExpr(location)
@@ -2390,7 +2389,7 @@ object Parsers {
2390
2389
case USCORE =>
2391
2390
atSpan(startOffset(t), in.skipToken()) { PostfixOp (t, Ident (nme.WILDCARD )) }
2392
2391
case _ =>
2393
- if in.isColon() && location == Location .InParens && followingIsLambdaParams() then
2392
+ if in.isColon && location == Location .InParens && followingIsLambdaParams() then
2394
2393
t match
2395
2394
case id @ Ident (name) =>
2396
2395
if name.is(WildcardParamName ) then
@@ -2494,7 +2493,7 @@ object Parsers {
2494
2493
! fn.isInstanceOf [Trees .Apply [? ]] // allow one () as annotation argument
2495
2494
else if lookahead.token == IDENTIFIER then
2496
2495
lookahead.nextToken()
2497
- ! lookahead.isColon()
2496
+ ! lookahead.isColon
2498
2497
else in.canStartExprTokens.contains(lookahead.token)
2499
2498
}
2500
2499
}
@@ -2727,7 +2726,7 @@ object Parsers {
2727
2726
*/
2728
2727
def pattern1 (location : Location = Location .InPattern ): Tree =
2729
2728
val p = pattern2()
2730
- if in.token == COLONop || in.token == COLONfollow then
2729
+ if in.isColon then
2731
2730
in.nextToken()
2732
2731
ascription(p, location)
2733
2732
else p
@@ -2928,7 +2927,7 @@ object Parsers {
2928
2927
if allowed.contains(in.token)
2929
2928
|| in.isSoftModifier
2930
2929
&& localModifierTokens.subsetOf(allowed) // soft modifiers are admissible everywhere local modifiers are
2931
- && ! in.lookahead.isColon()
2930
+ && ! in.lookahead.isColon
2932
2931
then
2933
2932
val isAccessMod = accessModifierTokens contains in.token
2934
2933
val mods1 = addModifier(mods)
@@ -3135,7 +3134,7 @@ object Parsers {
3135
3134
val isParams =
3136
3135
! impliedMods.is(Given )
3137
3136
|| startParamTokens.contains(in.token)
3138
- || isIdent && (in.name == nme.inline || in.lookahead.isColon() )
3137
+ || isIdent && (in.name == nme.inline || in.lookahead.isColon)
3139
3138
if isParams then commaSeparated(() => param())
3140
3139
else contextTypes(ofClass, nparams, impliedMods)
3141
3140
checkVarArgsRules(clause)
@@ -3748,7 +3747,7 @@ object Parsers {
3748
3747
isUsingClause(extParams)
3749
3748
do ()
3750
3749
leadParamss ++= paramClauses(givenOnly = true , numLeadParams = nparams)
3751
- if in.isColon() then
3750
+ if in.isColon then
3752
3751
syntaxError(" no `:` expected here" )
3753
3752
in.nextToken()
3754
3753
val methods : List [Tree ] =
@@ -3958,7 +3957,7 @@ object Parsers {
3958
3957
*/
3959
3958
def selfType (): ValDef =
3960
3959
if (in.isIdent || in.token == THIS )
3961
- && in.lookahead.token == COLONop && followingIsSelfType()
3960
+ && in.lookahead.isColon && followingIsSelfType()
3962
3961
|| in.lookahead.token == ARROW
3963
3962
then
3964
3963
atSpan(in.offset) {
@@ -3968,7 +3967,7 @@ object Parsers {
3968
3967
nme.WILDCARD
3969
3968
else ident()
3970
3969
val selfTpt =
3971
- if in.token == COLONfollow then
3970
+ if in.isColon then
3972
3971
in.nextToken()
3973
3972
infixType()
3974
3973
else
0 commit comments