5 releases

new 0.1.4 Nov 2, 2024
0.1.3 Jul 29, 2024
0.1.2 Jul 26, 2024
0.1.1 Jul 11, 2024
0.1.0 Jul 11, 2024

#720 in Development tools

MIT license

310KB
264 lines

reporting Crates.io Version docs.rs

Simple diagnostic reporting for compilers.

use reporting::{error, note, File, Location, Renderer, Styles};

fn main() {
    let file = File::new("test.txt", "import stds;");
    let styles = Styles::styled();

    print!(
        "{}",
        Renderer::new(
            &styles,
            &[
                error!("Could not find package `{}`", "stds")
                    .location(Location::new(file.clone(), 7)),
                note!("Perhaps you meant `std`?")
            ]
        )
    )
}

lib.rs:

Simple diagnostic reporting for compilers.

use reporting::{error, note, File, Location, Renderer, Styles};

let file = File::new("test.txt", "import stds;");
let styles = Styles::styled();

print!(
    "{}",
    Renderer::new(
        &styles,
        &[
            error!("Could not find package `{}`", "stds")
                .location(Location::new(file.clone(), 7)),
            note!("Perhaps you meant `std`?")
        ]
    )
);

Dependencies

~1.5MB
~23K SLoC