summaryrefslogtreecommitdiff
path: root/src/parse/scanner.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/parse/scanner.rs')
-rw-r--r--src/parse/scanner.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/parse/scanner.rs b/src/parse/scanner.rs
index 92a2333d..ea06a2e0 100644
--- a/src/parse/scanner.rs
+++ b/src/parse/scanner.rs
@@ -182,7 +182,13 @@ pub fn is_newline(character: char) -> bool {
)
}
-/// Whether a string is a valid identifier.
+/// Whether a string is a valid unicode identifier.
+///
+/// In addition to what is specified in the [Unicode Standard][uax31], we allow:
+/// - `_` as a starting character,
+/// - `_` and `-` as continuing characters.
+///
+/// [uax31]: http://www.unicode.org/reports/tr31/
#[inline]
pub fn is_ident(string: &str) -> bool {
let mut chars = string.chars();