Skip to content

Commit

Permalink
Output columns 1-based. Fixes #10848
Browse files Browse the repository at this point in the history
  • Loading branch information
jhasse committed Jan 2, 2014
1 parent 48918fa commit 3d43543
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/libsyntax/codemap.rs
Expand Up @@ -308,7 +308,7 @@ impl CodeMap {
pub fn mk_substr_filename(&self, sp: Span) -> ~str {
let pos = self.lookup_char_pos(sp.lo);
return format!("<{}:{}:{}>", pos.file.name,
pos.line, pos.col.to_uint());
pos.line, pos.col.to_uint() + 1)
}

/// Lookup source information about a BytePos
Expand Down Expand Up @@ -354,7 +354,7 @@ impl CodeMap {
let lo = self.lookup_char_pos_adj(sp.lo);
let hi = self.lookup_char_pos_adj(sp.hi);
return format!("{}:{}:{}: {}:{}", lo.filename,
lo.line, lo.col.to_uint(), hi.line, hi.col.to_uint())
lo.line, lo.col.to_uint() + 1, hi.line, hi.col.to_uint() + 1)
}

pub fn span_to_filename(&self, sp: Span) -> FileName {
Expand Down

0 comments on commit 3d43543

Please sign in to comment.