diff options
| author | bors <bors@rust-lang.org> | 2014-03-28 20:21:45 -0700 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2014-03-28 20:21:45 -0700 |
| commit | 6584f3746e552a626003f564e2f83262d93cbd57 (patch) | |
| tree | b5ee7f3495c68acd4fb712ca4f762b41bff384fb /src/libsyntax/parse/parser.rs | |
| parent | b334f7c3cc3fcab8170ccb46a1f9a12702a2582c (diff) | |
| parent | b0e3cb5f32ec25efb9af65293f9d776b6374b657 (diff) | |
| download | rust-6584f3746e552a626003f564e2f83262d93cbd57.tar.gz rust-6584f3746e552a626003f564e2f83262d93cbd57.zip | |
auto merge of #13170 : eddyb/rust/syntax-cleanup, r=alexcrichton
Removes all Cell's/RefCell's from lexer::Reader implementations and a couple @.
Diffstat (limited to 'src/libsyntax/parse/parser.rs')
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index aee843bd857..a20854884b2 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -80,6 +80,7 @@ use owned_slice::OwnedSlice; use collections::HashSet; use std::kinds::marker; use std::mem::replace; +use std::rc::Rc; use std::vec; #[allow(non_camel_case_types)] @@ -274,7 +275,7 @@ struct ParsedItemsAndViewItems { /* ident is handled by common.rs */ -pub fn Parser<'a>(sess: &'a ParseSess, cfg: ast::CrateConfig, rdr: ~Reader:) +pub fn Parser<'a>(sess: &'a ParseSess, cfg: ast::CrateConfig, mut rdr: ~Reader:) -> Parser<'a> { let tok0 = rdr.next_token(); let span = tok0.sp; @@ -328,7 +329,7 @@ pub struct Parser<'a> { restriction: restriction, quote_depth: uint, // not (yet) related to the quasiquoter reader: ~Reader:, - interner: @token::IdentInterner, + interner: Rc<token::IdentInterner>, /// The set of seen errors about obsolete syntax. Used to suppress /// extra detail when the same error is seen twice obsolete_set: HashSet<ObsoleteSyntax>, @@ -2104,7 +2105,7 @@ impl<'a> Parser<'a> { let seq = match seq { Spanned { node, .. } => node, }; - TTSeq(mk_sp(sp.lo, p.span.hi), @seq, s, z) + TTSeq(mk_sp(sp.lo, p.span.hi), Rc::new(seq), s, z) } else { TTNonterminal(sp, p.parse_ident()) } @@ -2147,7 +2148,7 @@ impl<'a> Parser<'a> { result.push(parse_any_tt_tok(self)); self.open_braces.pop().unwrap(); - TTDelim(@result) + TTDelim(Rc::new(result)) } _ => parse_non_delim_tt_tok(self) } |
