diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2013-03-07 18:37:22 -0500 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2013-03-08 09:54:20 -0500 |
| commit | 7f99a02ddb3ff30388ae1dd5db06e332c215fea2 (patch) | |
| tree | cfea745b79f58bad9266ddcb80490be166a45f5d /src/libsyntax/ext/tt/macro_parser.rs | |
| parent | 2a72099063b21abc84145960a14224458b6dc37c (diff) | |
| download | rust-7f99a02ddb3ff30388ae1dd5db06e332c215fea2.tar.gz rust-7f99a02ddb3ff30388ae1dd5db06e332c215fea2.zip | |
syntax: Remove uses of DVec
Diffstat (limited to 'src/libsyntax/ext/tt/macro_parser.rs')
| -rw-r--r-- | src/libsyntax/ext/tt/macro_parser.rs | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/libsyntax/ext/tt/macro_parser.rs b/src/libsyntax/ext/tt/macro_parser.rs index c66e726bbf7..88797a15206 100644 --- a/src/libsyntax/ext/tt/macro_parser.rs +++ b/src/libsyntax/ext/tt/macro_parser.rs @@ -19,8 +19,6 @@ use parse::parser::Parser; use parse::token::{Token, EOF, to_str, nonterminal}; use parse::token; -use core::dvec::DVec; -use core::dvec; use core::option::{Option, Some, None}; use core::str; use core::uint; @@ -115,7 +113,7 @@ pub struct MatcherPos { sep: Option<Token>, idx: uint, up: matcher_pos_up, // mutable for swapping only - matches: ~[DVec<@named_match>], + matches: ~[~[@named_match]], match_lo: uint, match_hi: uint, sp_lo: BytePos, } @@ -151,7 +149,7 @@ pub fn initial_matcher_pos(+ms: ~[matcher], +sep: Option<Token>, lo: BytePos) } } } - let matches = vec::from_fn(count_names(ms), |_i| dvec::DVec()); + let matches = vec::from_fn(count_names(ms), |_i| ~[]); ~MatcherPos { elts: ms, sep: sep, @@ -283,7 +281,7 @@ pub fn parse( // Only touch the binders we have actually bound for uint::range(ei.match_lo, ei.match_hi) |idx| { - let sub = ei.matches[idx].get(); + let sub = ei.matches[idx]; new_pos.matches[idx] .push(@matched_seq(sub, mk_sp(ei.sp_lo, @@ -331,7 +329,7 @@ pub fn parse( } let matches = vec::map(ei.matches, // fresh, same size: - |_m| DVec::<@named_match>()); + |_m| ~[]); let ei_t = ei; cur_eis.push(~MatcherPos { elts: copy *matchers, @@ -358,9 +356,11 @@ pub fn parse( /* error messages here could be improved with links to orig. rules */ if tok == EOF { if eof_eis.len() == 1u { - return success( - nameize(sess, ms, - eof_eis[0u].matches.map(|dv| dv.pop()))); + let mut v = ~[]; + for vec::each_mut(eof_eis[0u].matches) |dv| { + v.push(dv.pop()); + } + return success(nameize(sess, ms, v)); } else if eof_eis.len() > 1u { return error(sp, ~"Ambiguity: multiple successful parses"); } else { |
