about summary refs log tree commit diff
path: root/src/libsyntax/parse
diff options
context:
space:
mode:
Diffstat (limited to 'src/libsyntax/parse')
-rw-r--r--src/libsyntax/parse/mod.rs39
-rw-r--r--src/libsyntax/parse/parser.rs17
2 files changed, 31 insertions, 25 deletions
diff --git a/src/libsyntax/parse/mod.rs b/src/libsyntax/parse/mod.rs
index a0c73668a05..0ddf9111e02 100644
--- a/src/libsyntax/parse/mod.rs
+++ b/src/libsyntax/parse/mod.rs
@@ -326,19 +326,32 @@ mod test {
             @~"fn foo (x : int) { x; }",
             ~[],
             new_parse_sess(None));
-        assert_eq!(to_json_str(@tts),
-                    ~"[[\"tt_tok\",[null,[\"IDENT\",[\"fn\",false]]]],\
-                      [\"tt_tok\",[null,[\"IDENT\",[\"foo\",false]]]],\
-                      [\"tt_delim\",[[[\"tt_tok\",[null,[\"LPAREN\",[]]]],\
-                      [\"tt_tok\",[null,[\"IDENT\",[\"x\",false]]]],\
-                      [\"tt_tok\",[null,[\"COLON\",[]]]],\
-                      [\"tt_tok\",[null,[\"IDENT\",[\"int\",false]]]],\
-                      [\"tt_tok\",[null,[\"RPAREN\",[]]]]]]],\
-                      [\"tt_delim\",[[[\"tt_tok\",[null,[\"LBRACE\",[]]]],\
-                      [\"tt_tok\",[null,[\"IDENT\",[\"x\",false]]]],\
-                      [\"tt_tok\",[null,[\"SEMI\",[]]]],\
-                      [\"tt_tok\",[null,[\"RBRACE\",[]]]]]]]]"
-                   );
+        assert_eq!(
+            to_json_str(@tts),
+            ~"[\
+                [\"tt_tok\",null,[\"IDENT\",\"fn\",false]],\
+                [\"tt_tok\",null,[\"IDENT\",\"foo\",false]],\
+                [\
+                    \"tt_delim\",\
+                    [\
+                        [\"tt_tok\",null,\"LPAREN\"],\
+                        [\"tt_tok\",null,[\"IDENT\",\"x\",false]],\
+                        [\"tt_tok\",null,\"COLON\"],\
+                        [\"tt_tok\",null,[\"IDENT\",\"int\",false]],\
+                        [\"tt_tok\",null,\"RPAREN\"]\
+                    ]\
+                ],\
+                [\
+                    \"tt_delim\",\
+                    [\
+                        [\"tt_tok\",null,\"LBRACE\"],\
+                        [\"tt_tok\",null,[\"IDENT\",\"x\",false]],\
+                        [\"tt_tok\",null,\"SEMI\"],\
+                        [\"tt_tok\",null,\"RBRACE\"]\
+                    ]\
+                ]\
+            ]"
+        );
         let ast1 = new_parser_from_tts(new_parse_sess(None),~[],tts)
             .parse_item(~[]);
         let ast2 = parse_item_from_source_str(
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs
index c2e7ecacd20..6ca91791ffd 100644
--- a/src/libsyntax/parse/parser.rs
+++ b/src/libsyntax/parse/parser.rs
@@ -28,7 +28,7 @@ use ast::{expr_lit, expr_log, expr_loop, expr_loop_body, expr_mac};
 use ast::{expr_method_call, expr_paren, expr_path, expr_repeat};
 use ast::{expr_ret, expr_swap, expr_struct, expr_tup, expr_unary};
 use ast::{expr_vec, expr_vstore, expr_vstore_mut_box, expr_inline_asm};
-use ast::{expr_vstore_fixed, expr_vstore_slice, expr_vstore_box};
+use ast::{expr_vstore_slice, expr_vstore_box};
 use ast::{expr_vstore_mut_slice, expr_while, extern_fn, field, fn_decl};
 use ast::{expr_vstore_uniq, TyClosure, TyBareFn, Onceness, Once, Many};
 use ast::{foreign_item, foreign_item_const, foreign_item_fn, foreign_mod};
@@ -1223,7 +1223,7 @@ pub impl Parser {
             let lvl = self.parse_expr();
             self.expect(&token::COMMA);
             let e = self.parse_expr();
-            ex = expr_log(ast::log_other, lvl, e);
+            ex = expr_log(lvl, e);
             hi = self.span.hi;
             self.expect(&token::RPAREN);
         } else if self.eat_keyword(&~"return") {
@@ -2721,8 +2721,9 @@ pub impl Parser {
                     }
                     self.bump();
                 }
-                token::IDENT(*) => {
+                token::MOD_SEP | token::IDENT(*) => {
                     let maybe_bound = match *self.token {
+                        token::MOD_SEP => None,
                         token::IDENT(copy sid, _) => {
                             match *self.id_to_str(sid) {
                                 ~"send" |
@@ -2750,7 +2751,7 @@ pub impl Parser {
                             result.push(bound);
                         }
                         None => {
-                            let ty = self.parse_ty(false);
+                            let ty = self.parse_ty(true);
                             result.push(TraitTyParamBound(ty));
                         }
                     }
@@ -3099,14 +3100,6 @@ pub impl Parser {
     //    impl<T> Foo { ... }
     //    impl<T> ToStr for ~[T] { ... }
     fn parse_item_impl(&self, visibility: ast::visibility) -> item_info {
-        fn wrap_path(p: &Parser, pt: @path) -> @Ty {
-            @Ty {
-                id: p.get_id(),
-                node: ty_path(pt, p.get_id()),
-                span: pt.span,
-            }
-        }
-
         // First, parse type parameters if necessary.
         let generics = self.parse_generics();