@@ -135,10 +135,13 @@ object Scanners {
135
135
*/
136
136
protected def putChar (c : Char ): Unit = litBuf.append(c)
137
137
138
- /** Clear buffer and set name and token
139
- * If `target` is different from `this`, don't treat identifiers as end tokens
138
+ /** Finish an IDENTIFIER with `this.name`. */
139
+ inline def finishNamed (): Unit = finishNamedToken(IDENTIFIER , this )
140
+
141
+ /** Clear buffer and set name and token.
142
+ * If `target` is different from `this`, don't treat identifiers as end tokens.
140
143
*/
141
- def finishNamed (idtoken : Token = IDENTIFIER , target : TokenData = this ): Unit =
144
+ def finishNamedToken (idtoken : Token , target : TokenData ): Unit =
142
145
target.name = termName(litBuf.chars, 0 , litBuf.length)
143
146
litBuf.clear()
144
147
target.token = idtoken
@@ -996,7 +999,7 @@ object Scanners {
996
999
getLitChars('`' )
997
1000
if (ch == '`' ) {
998
1001
nextChar()
999
- finishNamed (BACKQUOTED_IDENT )
1002
+ finishNamedToken (BACKQUOTED_IDENT , target = this )
1000
1003
if (name.length == 0 )
1001
1004
error(" empty quoted identifier" )
1002
1005
else if (name == nme.WILDCARD )
@@ -1162,7 +1165,7 @@ object Scanners {
1162
1165
nextRawChar()
1163
1166
ch != SU && Character .isUnicodeIdentifierPart(ch)
1164
1167
do ()
1165
- finishNamed( target = next)
1168
+ finishNamedToken( IDENTIFIER , target = next)
1166
1169
}
1167
1170
else
1168
1171
error(" invalid string interpolation: `$$`, `$\" `, `$`ident or `$`BlockExpr expected" )
0 commit comments