Turn some functions from token.rs into methods on Ident

This commit is contained in:
Vadim Petrochenkov
2018-05-13 16:14:43 +03:00
parent f4cbc2388f
commit c4352ff198
10 changed files with 80 additions and 67 deletions

View File

@@ -1149,7 +1149,7 @@ impl<'a> StringReader<'a> {
return Ok(self.with_str_from(start, |string| {
// FIXME: perform NFKC normalization here. (Issue #2253)
let ident = self.mk_ident(string);
if is_raw_ident && (token::is_path_segment_keyword(ident) ||
if is_raw_ident && (ident.is_path_segment_keyword() ||
ident.name == keywords::Underscore.name()) {
self.fatal_span_(raw_start, self.pos,
&format!("`r#{}` is not currently supported.", ident.name)