vermouth 0.5.4

a new kind of parser for procedural macros
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use proc_macro::{Diagnostic, Level, Span};

use crate::{DiagnosticLevel, ToSpan, TokenQueue};

pub(super) fn emit(_q: &mut TokenQueue, level: DiagnosticLevel, span: Span, msg: String) {
    let (span, msg) = (span.span(), msg.to_string());
    let level = match level {
        DiagnosticLevel::Error => Level::Error,
        #[cfg(feature = "warnings")]
        DiagnosticLevel::Warning => Level::Warning,
    };
    Diagnostic::spanned(span, level, msg).emit()
}