diff options
| author | Laurenz <laurmaedje@gmail.com> | 2021-01-03 00:12:09 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2021-01-03 00:12:09 +0100 |
| commit | aae67bd572ad86f4c57e364daa51a9dc883b8913 (patch) | |
| tree | 0aba021e0748ebad2197ea390385ec5f93ccbc6e /src/syntax/ident.rs | |
| parent | 1c40dc42e7bc7b799b77f06d25414aca59a044ba (diff) | |
Move and rename many things 🚛
Diffstat (limited to 'src/syntax/ident.rs')
| -rw-r--r-- | src/syntax/ident.rs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/syntax/ident.rs b/src/syntax/ident.rs index 4f3668c0..3cb47c47 100644 --- a/src/syntax/ident.rs +++ b/src/syntax/ident.rs @@ -1,5 +1,3 @@ -//! Unicode identifiers. - use std::ops::Deref; use unicode_xid::UnicodeXID; @@ -44,7 +42,7 @@ impl Deref for Ident { } } -/// Whether the string is a valid identifier. +/// Whether a string is a valid identifier. pub fn is_ident(string: &str) -> bool { let mut chars = string.chars(); chars @@ -52,12 +50,12 @@ pub fn is_ident(string: &str) -> bool { .map_or(false, |c| is_id_start(c) && chars.all(is_id_continue)) } -/// Whether the character can start an identifier. +/// Whether a character can start an identifier. pub fn is_id_start(c: char) -> bool { c.is_xid_start() || c == '_' } -/// Whether the character can continue an identifier. +/// Whether a character can continue an identifier. pub fn is_id_continue(c: char) -> bool { c.is_xid_continue() || c == '_' || c == '-' } |
