about summary refs log tree commit diff
path: root/src/comp/syntax/parse/parser.rs
diff options
context:
space:
mode:
authorPatrick Walton <pcwalton@mimiga.net>2011-07-05 17:50:14 -0700
committerPatrick Walton <pcwalton@mimiga.net>2011-07-06 15:15:06 -0700
commit479ce4d7836c13b3e75b2d0ac48e9f534ff859e7 (patch)
treee625b3ee41eab6654e559a4e27a59d43c4985774 /src/comp/syntax/parse/parser.rs
parent0226f561156e2e01941d643bf261729af4083cae (diff)
downloadrust-479ce4d7836c13b3e75b2d0ac48e9f534ff859e7.tar.gz
rust-479ce4d7836c13b3e75b2d0ac48e9f534ff859e7.zip
rustc: Move crate directives over to interior vectors
Diffstat (limited to 'src/comp/syntax/parse/parser.rs')
-rw-r--r--src/comp/syntax/parse/parser.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/comp/syntax/parse/parser.rs b/src/comp/syntax/parse/parser.rs
index 6769046a485..819efb2f7f2 100644
--- a/src/comp/syntax/parse/parser.rs
+++ b/src/comp/syntax/parse/parser.rs
@@ -2337,7 +2337,7 @@ fn parse_crate_from_source_file(&str input, &ast::crate_cfg cfg,
     auto first_item_outer_attrs = crate_attrs._1;
     auto m = parse_mod_items(p, token::EOF,
                              first_item_outer_attrs);
-    ret @spanned(lo, p.get_lo_pos(), rec(directives=[],
+    ret @spanned(lo, p.get_lo_pos(), rec(directives=~[],
                                          module=m,
                                          attrs=crate_attrs._0,
                                          config=p.get_cfg()));
@@ -2419,8 +2419,8 @@ fn parse_crate_directive(&parser p, &ast::attribute[] first_outer_attr)
 }
 
 fn parse_crate_directives(&parser p, token::token term,
-                          &ast::attribute[] first_outer_attr) ->
-   vec[@ast::crate_directive] {
+                          &ast::attribute[] first_outer_attr)
+        -> (@ast::crate_directive)[] {
 
     // This is pretty ugly. If we have an outer attribute then we can't accept
     // seeing the terminator next, so if we do see it then fail the same way
@@ -2429,10 +2429,10 @@ fn parse_crate_directives(&parser p, token::token term,
         expect_word(p, "mod");
     }
 
-    let vec[@ast::crate_directive] cdirs = [];
+    let (@ast::crate_directive)[] cdirs = ~[];
     while (p.peek() != term) {
         auto cdir = @parse_crate_directive(p, first_outer_attr);
-        vec::push(cdirs, cdir);
+        cdirs += ~[cdir];
     }
     ret cdirs;
 }