diff options
| author | Patrick Walton <pcwalton@mimiga.net> | 2014-01-15 18:30:40 -0800 |
|---|---|---|
| committer | Huon Wilson <dbau.pp+github@gmail.com> | 2014-02-02 01:44:48 +1100 |
| commit | f9af11d6cc0266a5690897b4645d8cab2ed1115b (patch) | |
| tree | 5389d0af37aa4d5207ac8ea5890183d81bc81d16 /src/libsyntax/parse | |
| parent | b496d7bec2a79feab092e6b4e251f7b0cee2a6a6 (diff) | |
| download | rust-f9af11d6cc0266a5690897b4645d8cab2ed1115b.tar.gz rust-f9af11d6cc0266a5690897b4645d8cab2ed1115b.zip | |
libsyntax: Remove all `@str` from the AST
Diffstat (limited to 'src/libsyntax/parse')
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index e86873d6418..07124120b12 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -5130,17 +5130,20 @@ impl Parser { } } - pub fn parse_optional_str(&mut self) -> Option<(@str, ast::StrStyle)> { + pub fn parse_optional_str(&mut self) + -> Option<(InternedString, ast::StrStyle)> { let (s, style) = match self.token { - token::LIT_STR(s) => (s, ast::CookedStr), - token::LIT_STR_RAW(s, n) => (s, ast::RawStr(n)), + token::LIT_STR(s) => (self.id_to_interned_str(s), ast::CookedStr), + token::LIT_STR_RAW(s, n) => { + (self.id_to_interned_str(s), ast::RawStr(n)) + } _ => return None }; self.bump(); - Some((ident_to_str(&s), style)) + Some((s, style)) } - pub fn parse_str(&mut self) -> (@str, StrStyle) { + pub fn parse_str(&mut self) -> (InternedString, StrStyle) { match self.parse_optional_str() { Some(s) => { s } _ => self.fatal("expected string literal") |
