about summary refs log tree commit diff
path: root/src/libsyntax/ext
diff options
context:
space:
mode:
authorBrian Anderson <banderson@mozilla.com>2012-11-12 18:24:56 -0800
committerBrian Anderson <banderson@mozilla.com>2012-11-12 18:24:56 -0800
commit2ec09c4eb91b94bd68c95eaa8966d4801c3347bf (patch)
tree74966da5517e5ea005bda5429ff9462f20f4abf3 /src/libsyntax/ext
parent15a5d2ccbf2de7ac0bb4894a6885791fa1f23521 (diff)
downloadrust-2ec09c4eb91b94bd68c95eaa8966d4801c3347bf.tar.gz
rust-2ec09c4eb91b94bd68c95eaa8966d4801c3347bf.zip
Objectify the codemap
Diffstat (limited to 'src/libsyntax/ext')
-rw-r--r--src/libsyntax/ext/qquote.rs6
-rw-r--r--src/libsyntax/ext/source_util.rs8
2 files changed, 7 insertions, 7 deletions
diff --git a/src/libsyntax/ext/qquote.rs b/src/libsyntax/ext/qquote.rs
index af7ffaa73f5..6ae083779cd 100644
--- a/src/libsyntax/ext/qquote.rs
+++ b/src/libsyntax/ext/qquote.rs
@@ -204,13 +204,13 @@ fn finish<T: qq_helper>
     -> @ast::expr
 {
     let cm = ecx.codemap();
-    let str = @codemap::span_to_snippet(body.span, cm);
+    let str = @cm.span_to_snippet(body.span);
     debug!("qquote--str==%?", str);
-    let fname = codemap::mk_substr_filename(cm, body.span);
+    let fname = cm.mk_substr_filename(body.span);
     let node = parse_from_source_str
         (f, fname, codemap::fss_internal(body.span), str,
          ecx.cfg(), ecx.parse_sess());
-    let loc = codemap::lookup_char_pos(cm, body.span.lo);
+    let loc = cm.lookup_char_pos(body.span.lo);
 
     let sp = node.span();
     let qcx = gather_anti_quotes(sp.lo, node);
diff --git a/src/libsyntax/ext/source_util.rs b/src/libsyntax/ext/source_util.rs
index 3181a604400..8c5048b4c6f 100644
--- a/src/libsyntax/ext/source_util.rs
+++ b/src/libsyntax/ext/source_util.rs
@@ -16,7 +16,7 @@ export expand_include_bin;
 fn expand_line(cx: ext_ctxt, sp: span, arg: ast::mac_arg,
                _body: ast::mac_body) -> @ast::expr {
     get_mac_args(cx, sp, arg, 0u, option::Some(0u), ~"line");
-    let loc = codemap::lookup_char_pos(cx.codemap(), sp.lo);
+    let loc = cx.codemap().lookup_char_pos(sp.lo);
     return mk_uint(cx, sp, loc.line);
 }
 
@@ -24,7 +24,7 @@ fn expand_line(cx: ext_ctxt, sp: span, arg: ast::mac_arg,
 fn expand_col(cx: ext_ctxt, sp: span, arg: ast::mac_arg,
               _body: ast::mac_body) -> @ast::expr {
     get_mac_args(cx, sp, arg, 0u, option::Some(0u), ~"col");
-    let loc = codemap::lookup_char_pos(cx.codemap(), sp.lo);
+    let loc = cx.codemap().lookup_char_pos(sp.lo);
     return mk_uint(cx, sp, loc.col);
 }
 
@@ -35,7 +35,7 @@ fn expand_file(cx: ext_ctxt, sp: span, arg: ast::mac_arg,
                _body: ast::mac_body) -> @ast::expr {
     get_mac_args(cx, sp, arg, 0u, option::Some(0u), ~"file");
     let loc { file: @filemap { name: filename, _ }, _ } =
-        codemap::lookup_char_pos(cx.codemap(), sp.lo);
+        cx.codemap().lookup_char_pos(sp.lo);
     return mk_uniq_str(cx, sp, filename);
 }
 
@@ -103,7 +103,7 @@ fn expand_include_bin(cx: ext_ctxt, sp: codemap::span, arg: ast::mac_arg,
 fn res_rel_file(cx: ext_ctxt, sp: codemap::span, arg: &Path) -> Path {
     // NB: relative paths are resolved relative to the compilation unit
     if !arg.is_absolute {
-        let cu = Path(codemap::span_to_filename(sp, cx.codemap()));
+        let cu = Path(cx.codemap().span_to_filename(sp));
         cu.dir_path().push_many(arg.components)
     } else {
         copy *arg