lwb-parser 0.1.7

parser framwork with automatically generated ASTs for the LWB project
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use miette::{GraphicalReportHandler, GraphicalTheme};

pub fn display_miette_error(err: &impl miette::Diagnostic) -> String {
    let mut s = String::new();
    if let Err(e) = GraphicalReportHandler::new()
        .with_links(true)
        .with_theme(GraphicalTheme::unicode())
        .render_report(&mut s, err)
    {
        eprintln!("{}", e);
        panic!();
    }
    s
}