diff options
| author | Brian Anderson <banderson@mozilla.com> | 2011-07-11 16:43:51 -0700 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2011-07-11 16:56:02 -0700 |
| commit | 08f8753d8036bcb51c8ead8a69fb16cacc8c80ec (patch) | |
| tree | 571d0a66e4a305c04b839af777234dd4a2df720b /src/comp/syntax/parse/parser.rs | |
| parent | 05390b4b38b7ac9d7645afa0be9089a763677393 (diff) | |
| download | rust-08f8753d8036bcb51c8ead8a69fb16cacc8c80ec.tar.gz rust-08f8753d8036bcb51c8ead8a69fb16cacc8c80ec.zip | |
Pull file reading out of the lexer
Diffstat (limited to 'src/comp/syntax/parse/parser.rs')
| -rw-r--r-- | src/comp/syntax/parse/parser.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/comp/syntax/parse/parser.rs b/src/comp/syntax/parse/parser.rs index 6fd0df76a0e..5bc919ac12c 100644 --- a/src/comp/syntax/parse/parser.rs +++ b/src/comp/syntax/parse/parser.rs @@ -113,10 +113,11 @@ fn new_parser(parse_sess sess, ast::crate_cfg cfg, auto ftype = SOURCE_FILE; if (str::ends_with(path, ".rc")) { ftype = CRATE_FILE; } auto srdr = io::file_reader(path); + auto src = str::unsafe_from_bytes(srdr.read_whole_stream()); auto filemap = codemap::new_filemap(path, pos); vec::push(sess.cm.files, filemap); auto itr = @interner::mk(str::hash, str::eq); - auto rdr = lexer::new_reader(sess.cm, srdr, filemap, itr); + auto rdr = lexer::new_reader(sess.cm, src, filemap, itr); // Make sure npos points at first actual token: lexer::consume_whitespace_and_comments(rdr); |
