diff options
| author | Patrick Walton <pcwalton@mimiga.net> | 2014-01-15 18:38:34 -0800 |
|---|---|---|
| committer | Huon Wilson <dbau.pp+github@gmail.com> | 2014-02-02 01:44:48 +1100 |
| commit | 3c9e9d35ac0f6469e0eeffc5c497f4b3ed6f1f8a (patch) | |
| tree | 22e6725b418795c2abc8cc478d9c745b3c46f2ac /src/libsyntax/parse/parser.rs | |
| parent | cbf9f5f5dfd5e3ec36899adf89c55a20380da63e (diff) | |
| download | rust-3c9e9d35ac0f6469e0eeffc5c497f4b3ed6f1f8a.tar.gz rust-3c9e9d35ac0f6469e0eeffc5c497f4b3ed6f1f8a.zip | |
libsyntax: Remove `ident_to_str` from the parser, which was returning
`@str` values
Diffstat (limited to 'src/libsyntax/parse/parser.rs')
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 07124120b12..cdf5d440380 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -531,10 +531,11 @@ impl Parser { // otherwise, eat it. pub fn expect_keyword(&mut self, kw: keywords::Keyword) { if !self.eat_keyword(kw) { - let id_str = self.id_to_str(kw.to_ident()).to_str(); + let id_ident = kw.to_ident(); + let id_interned_str = token::get_ident(id_ident.name); let token_str = self.this_token_to_str(); self.fatal(format!("expected `{}`, found `{}`", - id_str, + id_interned_str.get(), token_str)) } } @@ -802,10 +803,6 @@ impl Parser { self.sess.span_diagnostic.handler().abort_if_errors(); } - pub fn id_to_str(&mut self, id: Ident) -> @str { - get_ident_interner().get(id.name) - } - pub fn id_to_interned_str(&mut self, id: Ident) -> InternedString { get_ident(id.name) } @@ -3440,7 +3437,9 @@ impl Parser { loop { match self.token { token::LIFETIME(lifetime) => { - if "static" == self.id_to_str(lifetime) { + let lifetime_interned_string = + token::get_ident(lifetime.name); + if lifetime_interned_string.equiv(&("static")) { result.push(RegionTyParamBound); } else { self.span_err(self.span, @@ -4871,7 +4870,6 @@ impl Parser { let first_ident = self.parse_ident(); let mut path = ~[first_ident]; - debug!("parsed view path: {}", self.id_to_str(first_ident)); match self.token { token::EQ => { // x = foo::bar |
