cleanup, fix test case

This commit is contained in:
John Clements 2013-02-13 15:38:42 -08:00
parent 9d962d8466
commit f9d789fa08
4 changed files with 13 additions and 5 deletions

View File

@ -229,7 +229,7 @@ impl<A> DVec<A> {
impl<A: Copy> DVec<A> {
/**
* Append all elements of a vector to the end of the list.
* Append all elements of a vector to the end of the list
*
* Equivalent to `append_iter()` but potentially more efficient.
*/

View File

@ -59,7 +59,7 @@ pub enum MacResult {
MRExpr(@ast::expr),
MRItem(@ast::item),
MRAny(fn@()-> @ast::expr, fn@()-> Option<@ast::item>, fn@()->@ast::stmt),
MRDef(MacroDef),
MRDef(MacroDef)
}
pub enum SyntaxExtension {

View File

@ -217,7 +217,6 @@ pub impl Parser {
let mut first = true;
let mut v = ~[];
while self.token != token::GT
// wait... isn't this going to eat a whole '>>' ?
&& self.token != token::BINOP(token::SHR) {
match sep {
Some(ref t) => {

View File

@ -244,8 +244,17 @@ mod test {
~[],
new_parse_sess(None));
check_equal(to_json_str(tts as Encodable::<std::json::Encoder>),
//[["tt_tok",["IDENT","fn"]]]
~"abc"
~"[[\"tt_tok\",[,[\"IDENT\",[\"fn\",false]]]],\
[\"tt_tok\",[,[\"IDENT\",[\"foo\",false]]]],\
[\"tt_delim\",[[[\"tt_tok\",[,[\"LPAREN\",[]]]],\
[\"tt_tok\",[,[\"IDENT\",[\"x\",false]]]],\
[\"tt_tok\",[,[\"COLON\",[]]]],\
[\"tt_tok\",[,[\"IDENT\",[\"int\",false]]]],\
[\"tt_tok\",[,[\"RPAREN\",[]]]]]]],\
[\"tt_delim\",[[[\"tt_tok\",[,[\"LBRACE\",[]]]],\
[\"tt_tok\",[,[\"IDENT\",[\"x\",false]]]],\
[\"tt_tok\",[,[\"SEMI\",[]]]],\
[\"tt_tok\",[,[\"RBRACE\",[]]]]]]]]"
);
let ast1 = new_parser_from_tts(new_parse_sess(None),~[],tts)
.parse_item(~[]);