Implement GLB algorithm. (Issue #2263)

r=brson
This commit is contained in:
Niko Matsakis
2012-12-05 15:13:24 -08:00
parent 3b71d14442
commit c3a74d87bd
15 changed files with 511 additions and 101 deletions

View File

@@ -315,6 +315,10 @@ pub impl CodeMap {
}
pub fn span_to_str(&self, sp: span) -> ~str {
if self.files.len() == 0 && sp == ast_util::dummy_sp() {
return ~"no-location";
}
let lo = self.lookup_char_pos_adj(sp.lo);
let hi = self.lookup_char_pos_adj(sp.hi);
return fmt!("%s:%u:%u: %u:%u", lo.filename,