about summary refs log tree commit diff
path: root/src/comp
diff options
context:
space:
mode:
authorBrian Anderson <banderson@mozilla.com>2011-08-02 22:19:39 -0700
committerBrian Anderson <banderson@mozilla.com>2011-08-03 10:55:59 -0700
commite4da7c5bee6ca094eeb12a9f47d450e3f962f05c (patch)
tree879eb6d9a3b2f3600b43a8f56421d7e7b888b7d3 /src/comp
parent97a8784c984bd19bf0a369ad5c3f8472ebc646eb (diff)
downloadrust-e4da7c5bee6ca094eeb12a9f47d450e3f962f05c.tar.gz
rust-e4da7c5bee6ca094eeb12a9f47d450e3f962f05c.zip
parse_crate_from_source_str takes a parse_sess, not codemap
This was causing problems when reading from stdin for subsequent passes that
needed to generate node ids.
Diffstat (limited to 'src/comp')
-rw-r--r--src/comp/driver/rustc.rs2
-rw-r--r--src/comp/syntax/parse/parser.rs3
2 files changed, 2 insertions, 3 deletions
diff --git a/src/comp/driver/rustc.rs b/src/comp/driver/rustc.rs
index 77c2da6827a..9b71fc25ceb 100644
--- a/src/comp/driver/rustc.rs
+++ b/src/comp/driver/rustc.rs
@@ -106,7 +106,7 @@ fn parse_input_src(sess: session::session, cfg: &ast::crate_cfg,
     }.read_whole_stream();
     let src = str::unsafe_from_bytes_ivec(srcbytes);
     let crate = parser::parse_crate_from_source_str(infile, src, cfg,
-                                                    sess.get_codemap());
+                                                    sess.get_parse_sess());
     ret {crate: crate, src: src};
 }
 
diff --git a/src/comp/syntax/parse/parser.rs b/src/comp/syntax/parse/parser.rs
index 473ceb08b51..9e7f693c74b 100644
--- a/src/comp/syntax/parse/parser.rs
+++ b/src/comp/syntax/parse/parser.rs
@@ -2317,8 +2317,7 @@ fn parse_crate_from_source_file(input: &str, cfg: &ast::crate_cfg,
 }
 
 fn parse_crate_from_source_str(name: &str, source: &str, cfg: &ast::crate_cfg,
-                               cm: &codemap::codemap) -> @ast::crate {
-    let sess = @{cm: cm, mutable next_id: 0};
+                               sess: &parse_sess) -> @ast::crate {
     let ftype = SOURCE_FILE;
     let filemap = codemap::new_filemap(name, 0u, 0u);
     sess.cm.files += ~[filemap];