Skip to content

Commit 6aa95a3

Browse files
committed
Drop unused parsing methods
1 parent 5cbc840 commit 6aa95a3

File tree

1 file changed

+9
-29
lines changed

1 file changed

+9
-29
lines changed

compiler/src/dotty/tools/dotc/parsing/Parsers.scala

Lines changed: 9 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1040,37 +1040,17 @@ object Parsers {
10401040
atSpan(accept(USCORE)) { Ident(nme.WILDCARD) }
10411041

10421042
/** Accept identifier or match clause acting as a selector on given tree `t` */
1043-
def selector(t: Tree): Tree =
1043+
def selectorOrMatch(t: Tree): Tree =
10441044
atSpan(startOffset(t), in.offset) {
10451045
if in.token == MATCH then matchClause(t) else Select(t, ident())
10461046
}
10471047

1048-
def idSelector(t: Tree): Tree =
1048+
def selector(t: Tree): Tree =
10491049
atSpan(startOffset(t), in.offset) { Select(t, ident()) }
10501050

1051-
/** Selectors ::= id { `.' id }
1052-
*
1053-
* Accept `.' separated identifiers acting as a selectors on given tree `t`.
1054-
* @param finish An alternative parse in case the next token is not an identifier.
1055-
* If the alternative does not apply, its tree argument is returned unchanged.
1056-
*/
1057-
def selectors(t: Tree, finish: Tree => Tree): Tree = {
1058-
val t1 = finish(t)
1059-
if (t1 ne t) t1 else dotSelectors(selector(t), finish)
1060-
}
1061-
1062-
/** DotSelectors ::= { `.' id }
1063-
*
1064-
* Accept `.' separated identifiers acting as a selectors on given tree `t`.
1065-
* @param finish An alternative parse in case the token following a `.' is not an identifier.
1066-
* If the alternative does not apply, its tree argument is returned unchanged.
1067-
*/
1068-
def dotSelectors(t: Tree, finish: Tree => Tree = id): Tree =
1069-
if (in.token == DOT) { in.nextToken(); selectors(t, finish) }
1070-
else t
1071-
1072-
def dotSelections(t: Tree): Tree =
1073-
if (in.token == DOT) { in.nextToken(); dotSelections(t) }
1051+
/** DotSelectors ::= { `.' id } */
1052+
def dotSelectors(t: Tree): Tree =
1053+
if (in.token == DOT) { in.nextToken(); dotSelectors(selector(t)) }
10741054
else t
10751055

10761056
private val id: Tree => Tree = x => x
@@ -1091,7 +1071,7 @@ object Parsers {
10911071
val mix = mixinQualifierOpt()
10921072
val t = atSpan(start) { Super(This(qual), mix) }
10931073
accept(DOT)
1094-
idSelector(t)
1074+
selector(t)
10951075

10961076
if in.token == THIS then handleThis(EmptyTypeIdent)
10971077
else if in.token == SUPER then handleSuper(EmptyTypeIdent)
@@ -1623,7 +1603,7 @@ object Parsers {
16231603
in.nextToken()
16241604
atSpan(startOffset(t)) { SingletonTypeTree(t) }
16251605
else
1626-
singletonCompletion(idSelector(t))
1606+
singletonCompletion(selector(t))
16271607
else convertToTypeId(t)
16281608
singletonCompletion(simpleRef())
16291609
}
@@ -2282,7 +2262,7 @@ object Parsers {
22822262
in.token match {
22832263
case DOT =>
22842264
in.nextToken()
2285-
simpleExprRest(selector(t), canApply = true)
2265+
simpleExprRest(selectorOrMatch(t), canApply = true)
22862266
case LBRACKET =>
22872267
val tapp = atSpan(startOffset(t), in.offset) { TypeApply(t, typeArgs(namedOK = true, wildOK = false)) }
22882268
simpleExprRest(tapp, canApply = true)
@@ -2698,7 +2678,7 @@ object Parsers {
26982678
def simplePatternRest(t: Tree): Tree =
26992679
if in.token == DOT then
27002680
in.nextToken()
2701-
simplePatternRest(idSelector(t))
2681+
simplePatternRest(selector(t))
27022682
else
27032683
var p = t
27042684
if (in.token == LBRACKET)

0 commit comments

Comments
 (0)