commit | 70c61e1ebd1b0270953b8e33b74bfff578ccc82f | [log] [tgz] |
---|---|---|
author | Kornel Lesiński <kornel@geekhood.net> | Wed Feb 15 19:12:22 2017 +0000 |
committer | Kornel Lesiński <kornel@geekhood.net> | Wed Feb 15 19:12:22 2017 +0000 |
tree | 34f7ead85aab0d297382fb050583504a1b9e0623 | |
parent | 4a14681bf8f224e0eb19d09bf75bebfa2b40d8ef [diff] |
Docs
diff --git a/src/ir/ty.rs b/src/ir/ty.rs index 470d953..332ad23 100644 --- a/src/ir/ty.rs +++ b/src/ir/ty.rs
@@ -316,6 +316,9 @@ _ => false, } } + + /// Checks whether the name looks like an identifier, + /// i.e. is alphanumeric (including '_') and does not start with a digit. pub fn is_valid_identifier(name: &str) -> bool { let mut chars = name.chars(); let first_valid = chars.next().map(|c| c.is_alphabetic() || c == '_').unwrap_or(false);