Implement non-internal ivecs

Vectors are now similar to our old, pre-internal vectors, except that
they are uniquely owned, not refcounted.

Their name should probably change too, then. I've renamed them to vec
in the runtime, will do so throughout the compiler later.
This commit is contained in:
Marijn Haverbeke 2011-08-25 10:18:02 +02:00
parent 855e0a4713
commit c9c5ee252a
27 changed files with 493 additions and 1554 deletions

View file

@ -60,7 +60,7 @@ type parser =
fn get_sess() -> parse_sess;
};
fn new_parser_from_file(sess: parse_sess, cfg: ast::crate_cfg, path: &istr,
fn new_parser_from_file(sess: parse_sess, cfg: &ast::crate_cfg, path: &istr,
chpos: uint, byte_pos: uint, ftype: file_type) ->
parser {
let src = io::read_whole_file_str(path);
@ -69,11 +69,10 @@ fn new_parser_from_file(sess: parse_sess, cfg: ast::crate_cfg, path: &istr,
sess.cm.files += [filemap];
let itr = @interner::mk(istr::hash, istr::eq);
let rdr = lexer::new_reader(sess.cm, src, filemap, itr);
ret new_parser(sess, cfg, rdr, ftype);
}
fn new_parser(sess: parse_sess, cfg: ast::crate_cfg, rdr: lexer::reader,
fn new_parser(sess: parse_sess, cfg: &ast::crate_cfg, rdr: lexer::reader,
ftype: file_type) -> parser {
obj stdio_parser(sess: parse_sess,
cfg: ast::crate_cfg,
@ -141,7 +140,6 @@ fn new_parser(sess: parse_sess, cfg: ast::crate_cfg, rdr: lexer::reader,
fn get_id() -> node_id { ret next_node_id(sess); }
fn get_sess() -> parse_sess { ret sess; }
}
let tok0 = lexer::next_token(rdr);
let span0 = ast_util::mk_sp(tok0.chpos, rdr.get_chpos());
ret stdio_parser(sess, cfg, ftype, tok0.tok, span0, span0, [],