From 1af3174fe3b565371a5978381f604ea9c01e86d3 Mon Sep 17 00:00:00 2001 From: Marijn Haverbeke Date: Fri, 8 Apr 2011 18:44:20 +0200 Subject: Move to single-uint file-position representation. This makes passing them around cheaper. There is now a table (see front/codemap.rs) that is needed to transform such an uint into an actual filename/line/col location. Also cleans up the span building in the parser a bit. --- src/comp/driver/rustc.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/comp/driver/rustc.rs') diff --git a/src/comp/driver/rustc.rs b/src/comp/driver/rustc.rs index 28953696..c2f63368 100644 --- a/src/comp/driver/rustc.rs +++ b/src/comp/driver/rustc.rs @@ -62,7 +62,7 @@ impure fn compile_input(session.session sess, bool parse_only, vec[str] library_search_paths) { auto def = tup(0, 0); - auto p = parser.new_parser(sess, env, def, input); + auto p = parser.new_parser(sess, env, def, input, 0u); auto crate = parse_input(sess, p, input); if (parse_only) {ret;} crate = creader.read_crates(sess, crate, library_search_paths); @@ -79,7 +79,7 @@ impure fn pretty_print_input(session.session sess, eval.env env, str input) { auto def = tup(0, 0); - auto p = front.parser.new_parser(sess, env, def, input); + auto p = front.parser.new_parser(sess, env, def, input, 0u); auto crate = front.parser.parse_crate_from_source_file(p); pretty.pprust.print_file(crate.node.module, input, std.io.stdout()); } @@ -125,7 +125,8 @@ impure fn main(vec[str] args) { auto crate_cache = common.new_int_hash[session.crate_metadata](); auto target_crate_num = 0; - auto sess = session.session(target_crate_num, target_cfg, crate_cache); + auto sess = session.session(target_crate_num, target_cfg, crate_cache, + front.codemap.new_codemap()); let option.t[str] input_file = none[str]; let option.t[str] output_file = none[str]; -- cgit v1.2.3