From f9d789fa083220cc9d84cbea94868606600c64a9 Mon Sep 17 00:00:00 2001 From: John Clements Date: Wed, 13 Feb 2013 15:38:42 -0800 Subject: [PATCH] cleanup, fix test case --- src/libcore/dvec.rs | 2 +- src/libsyntax/ext/base.rs | 2 +- src/libsyntax/parse/common.rs | 1 - src/libsyntax/parse/mod.rs | 13 +++++++++++-- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/libcore/dvec.rs b/src/libcore/dvec.rs index c7a0300a978..fe36ed15960 100644 --- a/src/libcore/dvec.rs +++ b/src/libcore/dvec.rs @@ -229,7 +229,7 @@ impl DVec { impl DVec { /** - * 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. */ diff --git a/src/libsyntax/ext/base.rs b/src/libsyntax/ext/base.rs index a85a7990ace..c924acd577d 100644 --- a/src/libsyntax/ext/base.rs +++ b/src/libsyntax/ext/base.rs @@ -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 { diff --git a/src/libsyntax/parse/common.rs b/src/libsyntax/parse/common.rs index 7e74163b6bf..e7b5005d8db 100644 --- a/src/libsyntax/parse/common.rs +++ b/src/libsyntax/parse/common.rs @@ -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) => { diff --git a/src/libsyntax/parse/mod.rs b/src/libsyntax/parse/mod.rs index b863e2bd0e4..12038898a9d 100644 --- a/src/libsyntax/parse/mod.rs +++ b/src/libsyntax/parse/mod.rs @@ -244,8 +244,17 @@ mod test { ~[], new_parse_sess(None)); check_equal(to_json_str(tts as Encodable::), - //[["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(~[]);