-
-
Save mod7ex/67ec2e6d7255bc3672f7b87326eb872b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
To | From | Method | |
---|---|---|---|
string of code | literal code | std::stringify!{} | |
string of code | syntax tree | !quote(#syntax_tree).to_string() | |
string of code | TokenStream | .to_string() | |
string of syntax | literal code | format!("{:?}",parse2::<SynType>(quote! {...}).expect(...) | |
string of syntax | syntax tree | format!("{:?}"),…), format!("{:#?}"),…) | |
string of tokens | literal code | format!("{:?}",quote! {...}) | |
string of tokens | TokenStream | format!("{:?}"),…), format!("{:#?}"),…) | |
syn::Error | TokenStream | .to_compile_error() [see Rule #7] | |
syntax tree | literal code | parse_quote!(…) | |
syntax tree | proc_macro::TokenStream | parse_macro_input!(…), parse | |
syntax tree | string of code | parse_str(…) | |
syntax tree | TokenStream | parse2::<SynType>(…), etc | |
TokenStream | literal code | quote!(…) | |
TokenStream | string of code | parse_str(…) | |
TokenStream | syntrax tree | quote!(#syntax_tree) or .to_token_stream(), | |
TokenStream | TokenStream | .into(), ::from(...) [see Rule #1] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment