diff options
| author | Nicholas Nethercote <nnethercote@mozilla.com> | 2018-05-31 10:52:29 +1000 |
|---|---|---|
| committer | Nicholas Nethercote <nnethercote@mozilla.com> | 2018-05-31 16:04:33 +1000 |
| commit | 3af6291effa78880e8318425d7327577eb265b66 (patch) | |
| tree | a552d7a405f29f7a13de2bc3c2778e09da31fd64 /src/libsyntax/parse/lexer | |
| parent | 1a6bda68cd9d5072f56783f22f7468c19289a020 (diff) | |
| download | rust-3af6291effa78880e8318425d7327577eb265b66.tar.gz rust-3af6291effa78880e8318425d7327577eb265b66.zip | |
Tweak identifer lexing.
By calling `bump()` after getting the first char, to avoid a redundant `ident_continue()` test on it.
Diffstat (limited to 'src/libsyntax/parse/lexer')
| -rw-r--r-- | src/libsyntax/parse/lexer/mod.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/libsyntax/parse/lexer/mod.rs b/src/libsyntax/parse/lexer/mod.rs index c39eb1594b2..02f76fa56e4 100644 --- a/src/libsyntax/parse/lexer/mod.rs +++ b/src/libsyntax/parse/lexer/mod.rs @@ -516,6 +516,7 @@ impl<'a> StringReader<'a> { return None; } let start = self.pos; + self.bump(); while ident_continue(self.ch) { self.bump(); } @@ -1155,6 +1156,7 @@ impl<'a> StringReader<'a> { } let start = self.pos; + self.bump(); while ident_continue(self.ch) { self.bump(); } |
