From 70c61e1ebd1b0270953b8e33b74bfff578ccc82f Mon Sep 17 00:00:00 2001 From: Kornel Lesiński Date: Wed, 15 Feb 2017 19:12:22 +0000 Subject: Docs --- src/ir/ty.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/ir/ty.rs b/src/ir/ty.rs index 470d9536..332ad236 100644 --- a/src/ir/ty.rs +++ b/src/ir/ty.rs @@ -316,6 +316,9 @@ impl Type { _ => 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); -- cgit v1.2.3