astray_macro

Crates.ioastray_macro
lib.rsastray_macro
version0.2.5
sourcesrc
created_at2023-02-16 23:15:39.10327
updated_at2023-07-30 11:03:28.659362
descriptionEasily build AST from Rust structures
homepage
repositoryhttps://www.github.com/giluis/astray.git
max_upload_size
id787110
size26,383
Luís Gil (giluis)

documentation

README

TODO

-[X] Box -[X] Vec -[ ] Functional Aproach -[ ] Enums with fieldless variants (check Operator @ tests/std_types/box.rs) -[ ] Proper documentation

What is generated

// /** // * impl Parsable<#Token> for #Type { // * fn parse(iter: &mut TokenIter) -> Result<#Type, ParseError<#Token>> { // * ( // * // in case it is a struct Node // * let #field_name = iter.parse().map_err(|err| ParseError::from_conjunct_error(err))?; // * // in case it is an enum Node // * let #field_name ## _err = iter.parse()?.map(|result: #field_type |#Type::#field_name(result)).hatch()?; // * ) * // repeat for each field // * // * // if struct Node // * Ok(#Type {#(#field_name)}) // * // else if enum Node // * Err(ParseError::from_disjunct_errors(#(#field_name##_err))) // * } // * } // */

Commit count: 0

cargo fmt