Skip to content

Commit

Permalink
Tweak identifer lexing.
Browse files Browse the repository at this point in the history
By calling `bump()` after getting the first char, to avoid a redundant
`ident_continue()` test on it.
  • Loading branch information
nnethercote committed May 31, 2018
1 parent 1a6bda6 commit 3af6291
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/libsyntax/parse/lexer/mod.rs
Expand Up @@ -516,6 +516,7 @@ impl<'a> StringReader<'a> {
return None;
}
let start = self.pos;
self.bump();
while ident_continue(self.ch) {
self.bump();
}
Expand Down Expand Up @@ -1155,6 +1156,7 @@ impl<'a> StringReader<'a> {
}

let start = self.pos;
self.bump();
while ident_continue(self.ch) {
self.bump();
}
Expand Down

0 comments on commit 3af6291

Please sign in to comment.