#syn #quote #procedural #macros #str

no-std syn_str

This library is what syn is to proc_macro::TokenStream for proc_macro::TokenStream::to_string,quote! being format! with String::parse::

11 releases

✓ Uses Rust 2018 edition

new 0.1.58 Jan 20, 2020
0.1.50 Jan 20, 2020

#45 in Procedural macro helpers

Download history 132/week @ 2020-01-13

56 downloads per month
Used in 1 crate

Apache-2.0/MIT

83KB
2.5K SLoC

syn_str

This rust library is designed specially for those who want to create procedural macros thought string manipulation,using proc_macro::TokenStream::to_string and String::parse::<TokenStream>,bringing useful types that separe the importants parts of an item and provide display impl's of they as if it were never parsed.

When parsing a struct the fields are ordered from less to big alignment,better ideas for align them are welcome.

This rust library parses well stringified items that give no syntax errors,in the opposite the functions can misbehave instead of throwing errors,as such this crate is intended for build procedural macros and an item with invalid syntax throws a compiler error before a procedural macro attribute can do anything.

Support for expressions,functions and traits will come in the future.

This rust library is no_std.


lib.rs:

This crate is designed specially for those who want to create procedural macros thought string manipulation,using proc_macro::TokenStream::to_string and String::parse::<TokenStream>,bringing useful types that separe the importants parts of an item and provide display impl's of they as if it were never parsed.

When parsing a struct the fields are ordered from less to big alignment,better ideas for align them are welcome.

This crate parses well stringified items that give no syntax errors,in the opposite the functions can misbehave instead of throwing errors,as such this crate is intended for build procedural macros and an item with invalid syntax throws a compiler error before a procedural macro attribute can do anything.

Support for expressions,functions and traits will come in the future.

This crate is no_std.

Dependencies