diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2013-09-12 00:50:19 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2013-09-12 01:07:10 -0700 |
| commit | a018a5c3433e20a56f642082586f4e4d28469381 (patch) | |
| tree | 42c6064f15a48bb8e3152266d1693285faf3036a /src/libstd/fmt | |
| parent | 03ca1befb31e711fa6ed74e1dd454c5be55694c4 (diff) | |
| download | rust-a018a5c3433e20a56f642082586f4e4d28469381.tar.gz rust-a018a5c3433e20a56f642082586f4e4d28469381.zip | |
Parse underscores in identifiers for format!
Closes #9119
Diffstat (limited to 'src/libstd/fmt')
| -rw-r--r-- | src/libstd/fmt/parse.rs | 4 |
1 files changed, 2 insertions, 2 deletions
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 } |
