aboutsummaryrefslogtreecommitdiff
path: root/src/comp/driver/session.rs
blob: 3b92e073e688610a0b893f1cf4837bbd057d6381 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import util.common.span;
import std._uint;

io obj session() {
    io 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;
        fail;
    }

    io fn err(str msg) {
        let str s = "error: ";
        s += msg;
        log s;
        fail;
    }
}


// Local Variables:
// fill-column: 78;
// indent-tabs-mode: nil
// c-basic-offset: 4
// buffer-file-coding-system: utf-8-unix
// compile-command: "make -k -C ../.. 2>&1 | sed -e 's/\\/x\\//x:\\//g'";
// End: