From 3af6291effa78880e8318425d7327577eb265b66 Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Thu, 31 May 2018 10:52:29 +1000 Subject: Tweak identifer lexing. By calling `bump()` after getting the first char, to avoid a redundant `ident_continue()` test on it. --- src/libsyntax/parse/lexer/mod.rs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/libsyntax/parse') 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(); } -- cgit 1.4.1-3-g733a5