cgp-component-macro-lib 0.3.0

Context-generic programming core component macros implemented as a library.
Documentation
1
2
3
4
5
6
7
8
9
use syn::{parse_quote, Type};

pub fn symbol_from_string(value: &str) -> Type {
    value
        .chars()
        .rfold(parse_quote! { Nil }, |tail, c: char| -> Type {
            parse_quote!( Cons< Char< #c >, #tail > )
        })
}