From 79022b185809b615502ef165e61f8e86212ea845 Mon Sep 17 00:00:00 2001 From: ekicyou Date: Wed, 29 Jul 2020 06:54:23 +0900 Subject: [PATCH] refactoring --- src/token.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/token.rs b/src/token.rs index ec357a71..d79c5f72 100644 --- a/src/token.rs +++ b/src/token.rs @@ -1399,7 +1399,7 @@ pub fn is_valid_identifier(name: impl Iterator) -> bool { for ch in name { match ch { '_' => (), - _ if is_first_alphabetic(ch) => first_alphabetic = true, + _ if is_id_first_alphabetic(ch) => first_alphabetic = true, _ if !first_alphabetic => return false, _ if char::is_ascii_alphanumeric(&ch) => (), _ => return false, @@ -1409,7 +1409,7 @@ pub fn is_valid_identifier(name: impl Iterator) -> bool { first_alphabetic } -fn is_first_alphabetic(x: char) -> bool { +fn is_id_first_alphabetic(x: char) -> bool { x.is_ascii_alphabetic() }