about summary refs log tree commit diff
path: root/src/libsyntax/parse
diff options
context:
space:
mode:
authorErick Tryzelaar <erick.tryzelaar@gmail.com>2013-01-13 16:51:48 -0800
committerErick Tryzelaar <erick.tryzelaar@gmail.com>2013-01-14 18:15:54 -0800
commit4b0f702608d11a45491cc4a07e3b968d4a917f2e (patch)
tree3c8cbf51a5486a189b13832e1cd641119ed04bc3 /src/libsyntax/parse
parenteafed93d72845581e04bacd3aaea4b28a3f49396 (diff)
downloadrust-4b0f702608d11a45491cc4a07e3b968d4a917f2e.tar.gz
rust-4b0f702608d11a45491cc4a07e3b968d4a917f2e.zip
convert ast::attribute_ and ast::view_item to a struct
Diffstat (limited to 'src/libsyntax/parse')
-rw-r--r--src/libsyntax/parse/attr.rs10
-rw-r--r--src/libsyntax/parse/parser.rs14
2 files changed, 14 insertions, 10 deletions
diff --git a/src/libsyntax/parse/attr.rs b/src/libsyntax/parse/attr.rs
index 49197be4bb9..375fefa64b4 100644
--- a/src/libsyntax/parse/attr.rs
+++ b/src/libsyntax/parse/attr.rs
@@ -72,8 +72,9 @@ impl Parser: parser_attr {
         let meta_item = self.parse_meta_item();
         self.expect(token::RBRACKET);
         let mut hi = self.span.hi;
-        return spanned(lo, hi, {style: style, value: *meta_item,
-                             is_sugared_doc: false});
+        return spanned(lo, hi, ast::attribute_ { style: style,
+                                                 value: *meta_item,
+                                                 is_sugared_doc: false });
     }
 
     // Parse attributes that appear after the opening of an item, each
@@ -101,8 +102,9 @@ impl Parser: parser_attr {
                     // It's not really an inner attribute
                     let outer_attr =
                         spanned(attr.span.lo, attr.span.hi,
-                            {style: ast::attr_outer, value: attr.node.value,
-                             is_sugared_doc: false});
+                            ast::attribute_ { style: ast::attr_outer,
+                                              value: attr.node.value,
+                                              is_sugared_doc: false });
                     next_outer_attrs += ~[outer_attr];
                     break;
                 }
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs
index f7651d31766..a5330b113dd 100644
--- a/src/libsyntax/parse/parser.rs
+++ b/src/libsyntax/parse/parser.rs
@@ -3276,12 +3276,12 @@ impl Parser {
         // extern mod foo;
         let metadata = self.parse_optional_meta();
         self.expect(token::SEMI);
-        return iovi_view_item(@{
+        iovi_view_item(@ast::view_item {
             node: view_item_use(ident, metadata, self.get_id()),
             attrs: attrs,
             vis: visibility,
             span: mk_sp(lo, self.last_span.hi)
-        });
+        })
     }
 
     fn parse_type_decl() -> {lo: BytePos, ident: ident} {
@@ -3573,7 +3573,7 @@ impl Parser {
         } else if self.eat_keyword(~"use") {
             let view_item = self.parse_use();
             self.expect(token::SEMI);
-            return iovi_view_item(@{
+            return iovi_view_item(@ast::view_item {
                 node: view_item,
                 attrs: attrs,
                 vis: visibility,
@@ -3582,7 +3582,7 @@ impl Parser {
         } else if self.eat_keyword(~"export") {
             let view_paths = self.parse_view_paths();
             self.expect(token::SEMI);
-            return iovi_view_item(@{
+            return iovi_view_item(@ast::view_item {
                 node: view_item_export(view_paths),
                 attrs: attrs,
                 vis: visibility,
@@ -3780,8 +3780,10 @@ impl Parser {
             fail;
         };
         self.expect(token::SEMI);
-        @{node: node, attrs: attrs,
-          vis: vis, span: mk_sp(lo, self.last_span.hi)}
+        @ast::view_item { node: node,
+                          attrs: attrs,
+                          vis: vis,
+                          span: mk_sp(lo, self.last_span.hi) }
     }
 
     fn parse_items_and_view_items(+first_item_attrs: ~[attribute],