From 41c6f985f5376b29224237141f451058eb5ebe6a Mon Sep 17 00:00:00 2001 From: Stephen Chung Date: Tue, 29 Dec 2020 11:37:15 +0800 Subject: [PATCH] Fix bug with tokenizing identifiers. --- src/token.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/token.rs b/src/token.rs index 752c1da4..54e1f1cc 100644 --- a/src/token.rs +++ b/src/token.rs @@ -1115,7 +1115,7 @@ fn get_next_token_inner( } } // 0x????, 0o????, 0b???? - ch @ 'x' | ch @ 'X' | ch @ 'o' | ch @ 'O' | ch @ 'b' | ch @ 'B' + ch @ 'x' | ch @ 'o' | ch @ 'b' | ch @ 'X' | ch @ 'O' | ch @ 'B' if c == '0' => { result.push(next_char); @@ -1184,11 +1184,11 @@ fn get_next_token_inner( // letter or underscore ... #[cfg(not(feature = "unicode-xid-ident"))] - ('A'..='Z', _) | ('a'..='z', _) | ('_', _) => { + ('a'..='z', _) | ('_', _) | ('A'..='Z', _) => { return get_identifier(stream, pos, start_pos, c); } #[cfg(feature = "unicode-xid-ident")] - (ch, _) if unicode_xid::UnicodeXID::is_xid_start(ch) => { + (ch, _) if unicode_xid::UnicodeXID::is_xid_start(ch) || ch == '_' => { return get_identifier(stream, pos, start_pos, c); }