From a018a5c3433e20a56f642082586f4e4d28469381 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Thu, 12 Sep 2013 00:50:19 -0700 Subject: Parse underscores in identifiers for format! Closes #9119 --- src/libstd/fmt/parse.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/libstd/fmt') diff --git a/src/libstd/fmt/parse.rs b/src/libstd/fmt/parse.rs index fd0e86d7a31..9888af9313b 100644 --- a/src/libstd/fmt/parse.rs +++ b/src/libstd/fmt/parse.rs @@ -554,7 +554,7 @@ impl<'self> Parser<'self> { /// characters. fn word(&mut self) -> &'self str { let start = match self.cur.clone().next() { - Some((pos, c)) if char::is_alphabetic(c) => { + Some((pos, c)) if char::is_XID_start(c) => { self.cur.next(); pos } @@ -563,7 +563,7 @@ impl<'self> Parser<'self> { let mut end; loop { match self.cur.clone().next() { - Some((_, c)) if char::is_alphanumeric(c) => { + Some((_, c)) if char::is_XID_continue(c) => { self.cur.next(); } Some((pos, _)) => { end = pos; break } -- cgit 1.4.1-3-g733a5