Remove DVec from syntax::parse
This commit is contained in:
parent
6efa3543a8
commit
7a6db3f982
2 changed files with 7 additions and 10 deletions
|
@ -227,12 +227,11 @@ mod test {
|
||||||
use super::*;
|
use super::*;
|
||||||
use std::serialize::Encodable;
|
use std::serialize::Encodable;
|
||||||
use std;
|
use std;
|
||||||
use core::dvec;
|
|
||||||
use core::str;
|
use core::str;
|
||||||
use util::testing::*;
|
use util::testing::*;
|
||||||
|
|
||||||
#[test] fn to_json_str (val: Encodable<std::json::Encoder>) -> ~str {
|
#[test] fn to_json_str (val: Encodable<std::json::Encoder>) -> ~str {
|
||||||
let bw = @io::BytesWriter {bytes: dvec::DVec(), pos: 0};
|
let bw = @io::BytesWriter();
|
||||||
val.encode(~std::json::Encoder(bw as io::Writer));
|
val.encode(~std::json::Encoder(bw as io::Writer));
|
||||||
str::from_bytes(bw.bytes.data)
|
str::from_bytes(bw.bytes.data)
|
||||||
}
|
}
|
||||||
|
|
|
@ -84,8 +84,6 @@ use print::pprust::expr_to_str;
|
||||||
use util::interner::Interner;
|
use util::interner::Interner;
|
||||||
|
|
||||||
use core::cmp;
|
use core::cmp;
|
||||||
use core::dvec::DVec;
|
|
||||||
use core::dvec;
|
|
||||||
use core::either::{Either, Left, Right};
|
use core::either::{Either, Left, Right};
|
||||||
use core::either;
|
use core::either;
|
||||||
use core::result::Result;
|
use core::result::Result;
|
||||||
|
@ -1323,11 +1321,11 @@ pub impl Parser {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn parse_all_token_trees() -> ~[token_tree] {
|
fn parse_all_token_trees() -> ~[token_tree] {
|
||||||
let tts = DVec();
|
let mut tts = ~[];
|
||||||
while self.token != token::EOF {
|
while self.token != token::EOF {
|
||||||
tts.push(self.parse_token_tree());
|
tts.push(self.parse_token_tree());
|
||||||
}
|
}
|
||||||
tts.get()
|
tts
|
||||||
}
|
}
|
||||||
|
|
||||||
fn parse_matchers() -> ~[matcher] {
|
fn parse_matchers() -> ~[matcher] {
|
||||||
|
@ -3954,7 +3952,7 @@ pub impl Parser {
|
||||||
VIEW_ITEMS_AND_ITEMS_ALLOWED | IMPORTS_AND_ITEMS_ALLOWED => false
|
VIEW_ITEMS_AND_ITEMS_ALLOWED | IMPORTS_AND_ITEMS_ALLOWED => false
|
||||||
};
|
};
|
||||||
|
|
||||||
let (view_items, items, foreign_items) = (DVec(), DVec(), DVec());
|
let mut (view_items, items, foreign_items) = (~[], ~[], ~[]);
|
||||||
loop {
|
loop {
|
||||||
match self.parse_item_or_view_item(attrs, items_allowed,
|
match self.parse_item_or_view_item(attrs, items_allowed,
|
||||||
foreign_items_allowed,
|
foreign_items_allowed,
|
||||||
|
@ -3986,9 +3984,9 @@ pub impl Parser {
|
||||||
}
|
}
|
||||||
|
|
||||||
{attrs_remaining: attrs,
|
{attrs_remaining: attrs,
|
||||||
view_items: dvec::unwrap(move view_items),
|
view_items: view_items,
|
||||||
items: dvec::unwrap(move items),
|
items: items,
|
||||||
foreign_items: dvec::unwrap(move foreign_items)}
|
foreign_items: foreign_items}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Parses a source module as a crate
|
// Parses a source module as a crate
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue