junobuild-macros 0.4.1

Procedural macros for hooking into various events in Juno.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
use proc_macro::TokenStream;

pub trait MacroError {
    fn to_error(&self) -> TokenStream;
}

impl MacroError for String {
    fn to_error(&self) -> TokenStream {
        let error_message = format!("compile_error!({self:?});");
        error_message.parse().expect("Failed to parse Juno code.")
    }
}