File tree Expand file tree Collapse file tree 1 file changed +5
-8
lines changed
Sources/SwiftParser/Lexer Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -1188,16 +1188,13 @@ extension Lexer.Cursor {
1188
1188
1189
1189
extension Lexer . Cursor {
1190
1190
mutating func lexMagicPoundLiteral( ) -> Lexer . Result {
1191
- let start = self
1192
- var clone = self
1191
+ var tmp = self
1193
1192
// Scan for [a-zA-Z]+ to see what we match.
1194
- if let peeked = clone. peek ( ) , Unicode . Scalar ( peeked) . isAsciiIdentifierStart {
1195
- repeat {
1196
- _ = clone. advance ( )
1197
- } while clone. peek ( ) . map { Unicode . Scalar ( $0) } ? . isAsciiIdentifierContinue == true
1193
+ while let peeked = tmp. peek ( ) , Unicode . Scalar ( peeked) . isAsciiIdentifierStart {
1194
+ _ = tmp. advance ( )
1198
1195
}
1199
1196
1200
- let literal = start . text ( upTo: clone )
1197
+ let literal = self . text ( upTo: tmp )
1201
1198
1202
1199
let kind : RawTokenKind
1203
1200
switch literal {
@@ -1220,7 +1217,7 @@ extension Lexer.Cursor {
1220
1217
}
1221
1218
1222
1219
// If we found something specific, return it.
1223
- self = clone
1220
+ self = tmp
1224
1221
return Lexer . Result ( kind)
1225
1222
}
1226
1223
}
You can’t perform that action at this time.
0 commit comments