aboutsummaryrefslogtreecommitdiff
path: root/src/comp/driver/rustc.rs
diff options
context:
space:
mode:
authorMarijn Haverbeke <[email protected]>2011-04-08 18:44:20 +0200
committerMarijn Haverbeke <[email protected]>2011-04-09 01:05:18 +0200
commit1af3174fe3b565371a5978381f604ea9c01e86d3 (patch)
tree1690b133b0690fdf6a2c005528355c2d00313129 /src/comp/driver/rustc.rs
parentMake lexer buffer the whole file (diff)
downloadrust-1af3174fe3b565371a5978381f604ea9c01e86d3.tar.xz
rust-1af3174fe3b565371a5978381f604ea9c01e86d3.zip
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.
Diffstat (limited to 'src/comp/driver/rustc.rs')
-rw-r--r--src/comp/driver/rustc.rs7
1 files changed, 4 insertions, 3 deletions
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];