qemit 0.1.0

A minimalist quasi-quoting library using declarative macros
Documentation
#[cfg(test)]
mod tests {
    use proc_macro2::{Ident, Span};
    use qemit::qemit;

    #[test]
    fn test_basic_interpolation() {
        let name = Ident::new("MyStruct", Span::call_site());
        let tokens = qemit! { struct ~name { } };
        assert_eq!(tokens.to_string(), "struct MyStruct { }");
    }

    #[test]
    fn test_multiple_interpolations() {
        let name = Ident::new("x", Span::call_site());
        let ty = Ident::new("u32", Span::call_site());
        let tokens = qemit! {let ~name : ~ty = 0 ;};
        assert_eq!(tokens.to_string(), "let x : u32 = 0 ;");
    }

    #[test]
    fn test_empty() {
        let tokens = qemit! {};
        assert_eq!(tokens.to_string(), "");
    }

    #[test]
    fn test_no_interpolation() {
        let tokens = qemit! {
            fn foo() {}
        };
        assert_eq!(tokens.to_string(), "fn foo () { }");
    }

    #[test]
    fn test_nested_stream() {
        let body = qemit! {x + 1};
        let tokens = qemit! {fn foo() { ~body }};
        assert_eq!(tokens.to_string(), "fn foo () { x + 1 }");
    }
}