about summary refs log tree commit diff
path: root/src/comp/syntax/parse
diff options
context:
space:
mode:
authorGraydon Hoare <graydon@mozilla.com>2011-07-25 14:04:38 -0700
committerGraydon Hoare <graydon@mozilla.com>2011-07-25 14:04:49 -0700
commit552bff8a2155e9e404a3cd279a26a374188d65f7 (patch)
treea5c387e899308e080e940b3367bd87bd2ddd149c /src/comp/syntax/parse
parent5749a2deac857e56b29ffb56b62dd383c3489eb3 (diff)
downloadrust-552bff8a2155e9e404a3cd279a26a374188d65f7.tar.gz
rust-552bff8a2155e9e404a3cd279a26a374188d65f7.zip
Adjust pp interface to that printing a crate (an reproducing literals/comments) takes a reader, not just a filename. Fixes first big pp-fuzzer bug.
Diffstat (limited to 'src/comp/syntax/parse')
-rw-r--r--src/comp/syntax/parse/lexer.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/comp/syntax/parse/lexer.rs b/src/comp/syntax/parse/lexer.rs
index 799050bb083..9f9c2a1f269 100644
--- a/src/comp/syntax/parse/lexer.rs
+++ b/src/comp/syntax/parse/lexer.rs
@@ -736,9 +736,9 @@ fn is_lit(&token::token t) -> bool {
 
 type lit = rec(str lit, uint pos);
 
-fn gather_comments_and_literals(&codemap::codemap cm, str path)
+fn gather_comments_and_literals(&codemap::codemap cm, str path,
+                                ioivec::reader srdr)
         -> rec(cmnt[] cmnts, lit[] lits) {
-    auto srdr = ioivec::file_reader(path);
     auto src = str::unsafe_from_bytes_ivec(srdr.read_whole_stream());
     auto itr = @interner::mk[str](str::hash, str::eq);
     auto rdr = new_reader(cm, src, codemap::new_filemap(path, 0u, 0u), itr);