vermouth 0.5.2

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

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

pub(super) fn emit(
    _q: &mut TokenQueue,
    level: DiagnosticLevel,
    span: impl ToSpan,
    msg: &impl ToString,
) {
    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()
}