diff options
| author | Aleksey Kladov <aleksey.kladov@gmail.com> | 2019-07-21 14:50:39 +0300 |
|---|---|---|
| committer | Aleksey Kladov <aleksey.kladov@gmail.com> | 2019-09-04 13:11:11 +0300 |
| commit | a0c186c34f67c7eb3b392755091dd3a17f5acbdf (patch) | |
| tree | 19df1cce8304c2ebf11afccf35968fa08d9e7ab1 /src/libsyntax | |
| parent | b9de4ef89e0e53099a084001b26ec3207c5f8391 (diff) | |
| download | rust-a0c186c34f67c7eb3b392755091dd3a17f5acbdf.tar.gz rust-a0c186c34f67c7eb3b392755091dd3a17f5acbdf.zip | |
remove XID and Pattern_White_Space unicode tables from libcore
They are only used by rustc_lexer, and are not needed elsewhere. So we move the relevant definitions into rustc_lexer (while the actual unicode data comes from the unicode-xid crate) and make the rest of the compiler use it.
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/ext/proc_macro_server.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libsyntax/ext/proc_macro_server.rs b/src/libsyntax/ext/proc_macro_server.rs index 1a26b17dac7..35feb6680f9 100644 --- a/src/libsyntax/ext/proc_macro_server.rs +++ b/src/libsyntax/ext/proc_macro_server.rs @@ -6,6 +6,7 @@ use crate::tokenstream::{self, DelimSpan, IsJoint::*, TokenStream, TreeAndJoint} use errors::{Diagnostic, DiagnosticBuilder}; use rustc_data_structures::sync::Lrc; +use rustc_lexer::character_properties::{is_id_start, is_id_continue}; use syntax_pos::{BytePos, FileName, MultiSpan, Pos, SourceFile, Span}; use syntax_pos::symbol::{kw, sym, Symbol}; @@ -322,8 +323,7 @@ impl Ident { fn is_valid(string: &str) -> bool { let mut chars = string.chars(); if let Some(start) = chars.next() { - (start == '_' || start.is_xid_start()) - && chars.all(|cont| cont == '_' || cont.is_xid_continue()) + is_id_start(start) && chars.all(is_id_continue) } else { false } |
