diff options
Diffstat (limited to 'src/comp/syntax/parse/eval.rs')
| -rw-r--r-- | src/comp/syntax/parse/eval.rs | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/src/comp/syntax/parse/eval.rs b/src/comp/syntax/parse/eval.rs index 897cfe03e09..ca7af9e273d 100644 --- a/src/comp/syntax/parse/eval.rs +++ b/src/comp/syntax/parse/eval.rs @@ -14,8 +14,6 @@ export eval_crate_directives_to_mod; type ctx = @{p: parser, sess: parser::parse_sess, - mutable chpos: uint, - mutable byte_pos: uint, cfg: ast::crate_cfg}; fn eval_crate_directives(cx: ctx, cdirs: [@ast::crate_directive], prefix: str, @@ -76,12 +74,12 @@ fn parse_companion_mod(cx: ctx, prefix: str, suffix: option::t<str>) if file_exists(modpath) { #debug("found companion mod"); let p0 = new_parser_from_file(cx.sess, cx.cfg, modpath, - cx.chpos, cx.byte_pos, SOURCE_FILE); + SOURCE_FILE); let inner_attrs = parse_inner_attrs_and_next(p0); let first_item_outer_attrs = inner_attrs.next; let m0 = parse_mod_items(p0, token::EOF, first_item_outer_attrs); - cx.chpos = p0.reader.chpos; - cx.byte_pos = p0.reader.pos; + cx.sess.chpos = p0.reader.chpos; + cx.sess.byte_pos = p0.reader.pos; ret (m0.view_items, m0.items, inner_attrs.inner); } else { ret ([], [], []); @@ -108,8 +106,7 @@ fn eval_crate_directive(cx: ctx, cdir: @ast::crate_directive, prefix: str, file_path } else { prefix + std::fs::path_sep() + file_path }; let p0 = - new_parser_from_file(cx.sess, cx.cfg, full_path, cx.chpos, - cx.byte_pos, SOURCE_FILE); + new_parser_from_file(cx.sess, cx.cfg, full_path, SOURCE_FILE); let inner_attrs = parse_inner_attrs_and_next(p0); let mod_attrs = attrs + inner_attrs.inner; let first_item_outer_attrs = inner_attrs.next; @@ -119,8 +116,8 @@ fn eval_crate_directive(cx: ctx, cdir: @ast::crate_directive, prefix: str, syntax::parse::parser::mk_item(p0, cdir.span.lo, cdir.span.hi, id, ast::item_mod(m0), mod_attrs); // Thread defids, chpos and byte_pos through the parsers - cx.chpos = p0.reader.chpos; - cx.byte_pos = p0.reader.pos; + cx.sess.chpos = p0.reader.chpos; + cx.sess.byte_pos = p0.reader.pos; items += [i]; } ast::cdir_dir_mod(id, cdirs, attrs) { |
