1
Fork 0

Return a is_raw parameter from Token::ident rather than having separate methods.

This commit is contained in:
Lymia Aluysia 2018-03-18 12:16:02 -05:00
parent d2e7953d13
commit 5c3d6320de
No known key found for this signature in database
GPG key ID: DB2E204C989251F7
3 changed files with 19 additions and 34 deletions

View file

@ -364,8 +364,8 @@ pub fn parse_failure_msg(tok: Token) -> String {
/// Perform a token equality check, ignoring syntax context (that is, an unhygienic comparison)
fn token_name_eq(t1: &Token, t2: &Token) -> bool {
if let (Some(id1), Some(id2)) = (t1.ident(), t2.ident()) {
id1.name == id2.name && t1.is_raw_ident() == t2.is_raw_ident()
if let (Some((id1, is_raw1)), Some((id2, is_raw2))) = (t1.ident(), t2.ident()) {
id1.name == id2.name && is_raw1 == is_raw2
} else if let (&token::Lifetime(id1), &token::Lifetime(id2)) = (t1, t2) {
id1.name == id2.name
} else {