Rewrite session formatting to use #fmt extension.
This commit is contained in:
parent
68321b0de8
commit
f747101b7c
1 changed files with 7 additions and 19 deletions
|
|
@ -3,33 +3,21 @@ import std._uint;
|
|||
|
||||
obj session() {
|
||||
fn span_err(span sp, str msg) {
|
||||
let str s = sp.filename;
|
||||
s += ':' as u8;
|
||||
// We really need #fmt soon!
|
||||
s += _uint.to_str(sp.lo.line, 10u);
|
||||
s += ':' as u8;
|
||||
s += _uint.to_str(sp.lo.col, 10u);
|
||||
s += ':' as u8;
|
||||
s += _uint.to_str(sp.hi.line, 10u);
|
||||
s += ':' as u8;
|
||||
s += _uint.to_str(sp.hi.col, 10u);
|
||||
s += ": error: ";
|
||||
s += msg;
|
||||
log s;
|
||||
log #fmt("%s:%u:%u:%u:%u: error: %s",
|
||||
sp.filename,
|
||||
sp.lo.line, sp.lo.col,
|
||||
sp.hi.line, sp.hi.col,
|
||||
msg);
|
||||
fail;
|
||||
}
|
||||
|
||||
fn err(str msg) {
|
||||
let str s = "error: ";
|
||||
s += msg;
|
||||
log s;
|
||||
log #fmt("error: %s", msg);
|
||||
fail;
|
||||
}
|
||||
|
||||
fn unimpl(str msg) {
|
||||
let str s = "error: unimplemented ";
|
||||
s += msg;
|
||||
log s;
|
||||
log #fmt("error: unimplemented %s", msg);
|
||||
fail;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue