Skip to content

Commit 79ac5a8

Browse files
committed
Replace all occurrences of Id, ident or Ident with id
To match the specs in https://github.com/lampepfl/dotty/blob/master/docs/syntax-summary.txt all occurences of Id, ident or Ident in comments have been replaced with the terminal `id`.
1 parent 84c7515 commit 79ac5a8

File tree

1 file changed

+36
-36
lines changed

1 file changed

+36
-36
lines changed

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

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,7 @@ object Parsers {
504504
def selector(t: Tree): Tree =
505505
atPos(startOffset(t), in.offset) { Select(t, ident()) }
506506

507-
/** Selectors ::= ident { `.' ident()
507+
/** Selectors ::= id { `.' id }
508508
*
509509
* Accept `.' separated identifiers acting as a selectors on given tree `t`.
510510
* @param finish An alternative parse in case the next token is not an identifier.
@@ -515,7 +515,7 @@ object Parsers {
515515
if (t1 ne t) t1 else dotSelectors(selector(t), finish)
516516
}
517517

518-
/** DotSelectors ::= { `.' ident()
518+
/** DotSelectors ::= { `.' id }
519519
*
520520
* Accept `.' separated identifiers acting as a selectors on given tree `t`.
521521
* @param finish An alternative parse in case the token following a `.' is not an identifier.
@@ -528,9 +528,9 @@ object Parsers {
528528
private val id: Tree => Tree = x => x
529529

530530
/** Path ::= StableId
531-
* | [Ident `.'] this
531+
* | [id `.'] this
532532
*
533-
* @param thisOK If true, [Ident `.'] this is acceptable as the path.
533+
* @param thisOK If true, the path can end with the keyword `this`.
534534
* If false, another selection is required after the `this`.
535535
* @param finish An alternative parse in case the token following a `.' is not an identifier.
536536
* If the alternative does not apply, its tree argument is returned unchanged.
@@ -565,20 +565,20 @@ object Parsers {
565565
}
566566
}
567567

568-
/** MixinQualifier ::= `[' Id `]'
568+
/** MixinQualifier ::= `[' id `]'
569569
*/
570570
def mixinQualifierOpt(): Ident =
571571
if (in.token == LBRACKET) inBrackets(atPos(in.offset) { typeIdent() })
572572
else EmptyTypeIdent
573573

574-
/** StableId ::= Id
575-
* | Path `.' Id
574+
/** StableId ::= id
575+
* | Path `.' id
576576
* | [id '.'] super [`[' id `]']`.' id
577577
*/
578578
def stableId(): Tree =
579579
path(thisOK = false)
580580

581-
/** QualId ::= Id {`.' Id}
581+
/** QualId ::= id {`.' id}
582582
*/
583583
def qualId(): Tree =
584584
dotSelectors(termIdent())
@@ -773,7 +773,7 @@ object Parsers {
773773
else t
774774

775775
/** SimpleType ::= SimpleType TypeArgs
776-
* | SimpleType `#' Id
776+
* | SimpleType `#' id
777777
* | StableId
778778
* | Path `.' type
779779
* | `(' ArgTypes `)'
@@ -959,7 +959,7 @@ object Parsers {
959959
/** Expr ::= [`implicit'] FunParams `=>' Expr
960960
* | Expr1
961961
* FunParams ::= Bindings
962-
* | Id
962+
* | id
963963
* | `_'
964964
* ExprInParens ::= PostfixExpr `:' Type
965965
* | Expr
@@ -975,12 +975,12 @@ object Parsers {
975975
* | `throw' Expr
976976
* | `return' [Expr]
977977
* | ForExpr
978-
* | [SimpleExpr `.'] Id `=' Expr
978+
* | [SimpleExpr `.'] id `=' Expr
979979
* | SimpleExpr1 ArgumentExprs `=' Expr
980980
* | PostfixExpr [Ascription]
981981
* | PostfixExpr `match' `{' CaseClauses `}'
982982
* Bindings ::= `(' [Binding {`,' Binding}] `)'
983-
* Binding ::= (Id | `_') [`:' Type]
983+
* Binding ::= (id | `_') [`:' Type]
984984
* Ascription ::= `:' CompoundType
985985
* | `:' Annotation {Annotation}
986986
* | `:' `_' `*'
@@ -1124,7 +1124,7 @@ object Parsers {
11241124
}
11251125

11261126
/** FunParams ::= Bindings
1127-
* | Id
1127+
* | id
11281128
* | `_'
11291129
* Bindings ::= `(' [Binding {`,' Binding}] `)'
11301130
*/
@@ -1153,7 +1153,7 @@ object Parsers {
11531153
(atPos(start) { makeParameter(name, t, mods) }) :: Nil
11541154
}
11551155

1156-
/** Binding ::= (Id | `_') [`:' Type]
1156+
/** Binding ::= (id | `_') [`:' Type]
11571157
*/
11581158
def binding(mods: Modifiers): Tree =
11591159
atPos(in.offset) { makeParameter(bindingName(), typedOpt(), mods) }
@@ -1165,8 +1165,8 @@ object Parsers {
11651165
}
11661166
else ident()
11671167

1168-
/** Expr ::= implicit Id `=>' Expr
1169-
* BlockResult ::= implicit Id [`:' InfixType] `=>' Block // Scala2 only
1168+
/** Expr ::= implicit id `=>' Expr
1169+
* BlockResult ::= implicit id [`:' InfixType] `=>' Block // Scala2 only
11701170
*/
11711171
def implicitClosure(start: Int, location: Location.Value, implicitMods: Modifiers): Tree =
11721172
closureRest(start, location, funParams(implicitMods, location))
@@ -1177,9 +1177,9 @@ object Parsers {
11771177
Function(params, if (location == Location.InBlock) block() else expr())
11781178
}
11791179

1180-
/** PostfixExpr ::= InfixExpr [Id [nl]]
1180+
/** PostfixExpr ::= InfixExpr [id [nl]]
11811181
* InfixExpr ::= PrefixExpr
1182-
* | InfixExpr Id [nl] InfixExpr
1182+
* | InfixExpr id [nl] InfixExpr
11831183
*/
11841184
def postfixExpr(): Tree =
11851185
infixOps(prefixExpr(), canStartExpressionTokens, prefixExpr, maybePostfix = true)
@@ -1204,7 +1204,7 @@ object Parsers {
12041204
* | xmlLiteral
12051205
* | Path
12061206
* | `(' [ExprsInParens] `)'
1207-
* | SimpleExpr `.' Id
1207+
* | SimpleExpr `.' id
12081208
* | SimpleExpr (TypeArgs | NamedTypeArgs)
12091209
* | SimpleExpr1 ArgumentExprs
12101210
*/
@@ -1456,7 +1456,7 @@ object Parsers {
14561456
p
14571457
}
14581458

1459-
/** InfixPattern ::= SimplePattern {Id [nl] SimplePattern}
1459+
/** InfixPattern ::= SimplePattern {id [nl] SimplePattern}
14601460
*/
14611461
def infixPattern(): Tree =
14621462
infixOps(simplePattern(), canStartExpressionTokens, simplePattern, notAnOperator = nme.raw.BAR)
@@ -1468,8 +1468,8 @@ object Parsers {
14681468
* | SimplePattern1 [TypeArgs] [ArgumentPatterns]
14691469
* SimplePattern1 ::= Path
14701470
* | `{' Block `}'
1471-
* | SimplePattern1 `.' Id
1472-
* PatVar ::= Id
1471+
* | SimplePattern1 `.' id
1472+
* PatVar ::= id
14731473
* | `_'
14741474
*/
14751475
val simplePattern = () => in.token match {
@@ -1586,7 +1586,7 @@ object Parsers {
15861586
def addMod(mods: Modifiers, mod: Mod): Modifiers =
15871587
addFlag(mods, mod.flags).withAddedMod(mod)
15881588

1589-
/** AccessQualifier ::= "[" (Id | this) "]"
1589+
/** AccessQualifier ::= "[" (id | this) "]"
15901590
*/
15911591
def accessQualifierOpt(mods: Modifiers): Modifiers =
15921592
if (in.token == LBRACKET) {
@@ -1665,16 +1665,16 @@ object Parsers {
16651665

16661666
/** ClsTypeParamClause::= `[' ClsTypeParam {`,' ClsTypeParam} `]'
16671667
* ClsTypeParam ::= {Annotation} [{Modifier} type] [`+' | `-']
1668-
* Id [HkTypeParamClause] TypeParamBounds
1668+
* id [HkTypeParamClause] TypeParamBounds
16691669
*
16701670
* DefTypeParamClause::= `[' DefTypeParam {`,' DefTypeParam} `]'
1671-
* DefTypeParam ::= {Annotation} Id [HkTypeParamClause] TypeParamBounds
1671+
* DefTypeParam ::= {Annotation} id [HkTypeParamClause] TypeParamBounds
16721672
*
16731673
* TypTypeParamCaluse::= `[' TypTypeParam {`,' TypTypeParam} `]'
1674-
* TypTypeParam ::= {Annotation} Id [HkTypePamClause] TypeBounds
1674+
* TypTypeParam ::= {Annotation} id [HkTypePamClause] TypeBounds
16751675
*
16761676
* HkTypeParamClause ::= `[' HkTypeParam {`,' HkTypeParam} `]'
1677-
* HkTypeParam ::= {Annotation} ['+' | `-'] (Id[HkTypePamClause] | _') TypeBounds
1677+
* HkTypeParam ::= {Annotation} ['+' | `-'] (id [HkTypePamClause] | _') TypeBounds
16781678
*/
16791679
def typeParamClause(ownerKind: ParamOwner.Value): List[TypeDef] = inBrackets {
16801680
def typeParam(): TypeDef = {
@@ -1829,7 +1829,7 @@ object Parsers {
18291829
}
18301830
}
18311831

1832-
/** ImportExpr ::= StableId `.' (Id | `_' | ImportSelectors)
1832+
/** ImportExpr ::= StableId `.' (id | `_' | ImportSelectors)
18331833
*/
18341834
val importExpr = () => path(thisOK = false, handleImport) match {
18351835
case imp: Import =>
@@ -1863,7 +1863,7 @@ object Parsers {
18631863
}
18641864
}
18651865

1866-
/** ImportSelector ::= Id [`=>' Id | `=>' `_']
1866+
/** ImportSelector ::= id [`=>' id | `=>' `_']
18671867
*/
18681868
def importSelector(): Tree = {
18691869
val from = termIdentOrWildcard()
@@ -1908,9 +1908,9 @@ object Parsers {
19081908
}
19091909

19101910
/** PatDef ::= Pattern2 {`,' Pattern2} [`:' Type] `=' Expr
1911-
* VarDef ::= PatDef | Id {`,' Id} `:' Type `=' `_'
1912-
* ValDcl ::= Id {`,' Id} `:' Type
1913-
* VarDcl ::= Id {`,' Id} `:' Type
1911+
* VarDef ::= PatDef | id {`,' id} `:' Type `=' `_'
1912+
* ValDcl ::= id {`,' id} `:' Type
1913+
* VarDcl ::= id {`,' id} `:' Type
19141914
*/
19151915
def patDefOrDcl(start: Offset, mods: Modifiers, docstring: Option[Comment] = None): Tree = atPos(start, nameStart) {
19161916
val lhs = commaSeparated(pattern2)
@@ -2012,8 +2012,8 @@ object Parsers {
20122012
Block(stats, Literal(Constant(())))
20132013
}
20142014

2015-
/** TypeDef ::= type Id [TypeParamClause] `=' Type
2016-
* TypeDcl ::= type Id [TypeParamClause] TypeBounds
2015+
/** TypeDef ::= type id [TypeParamClause] `=' Type
2016+
* TypeDcl ::= type id [TypeParamClause] TypeBounds
20172017
*/
20182018
def typeDefOrDcl(start: Offset, mods: Modifiers, docstring: Option[Comment] = None): Tree = {
20192019
newLinesOpt()
@@ -2055,7 +2055,7 @@ object Parsers {
20552055
}
20562056
}
20572057

2058-
/** ClassDef ::= Id [ClsTypeParamClause]
2058+
/** ClassDef ::= id [ClsTypeParamClause]
20592059
* [ConstrMods] ClsParamClauses TemplateOpt
20602060
*/
20612061
def classDef(start: Offset, mods: Modifiers, docstring: Option[Comment]): TypeDef = atPos(start, nameStart) {
@@ -2083,7 +2083,7 @@ object Parsers {
20832083
mods
20842084
}
20852085

2086-
/** ObjectDef ::= Id TemplateOpt
2086+
/** ObjectDef ::= id TemplateOpt
20872087
*/
20882088
def objectDef(start: Offset, mods: Modifiers, docstring: Option[Comment] = None): ModuleDef = atPos(start, nameStart) {
20892089
val name = ident()

0 commit comments

Comments
 (0)