libjuno 0.1.10

Library for JunoLang
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use super::{ classify, message, from_pest };

use crate::diagnostics::{ Diagnostic, DiagnosticBuilder, DiagnosticContext, Severity };

use crate::Rule;

pub fn parse(_ctx: &DiagnosticContext, error: pest::error::Error<Rule>) -> Diagnostic {
    let span = from_pest(&error);

    let rule = classify(&error);

    let message = message(rule);

    DiagnosticBuilder::new(Severity::Error, span, message).build()
}