Crates.io | astray_macro |
lib.rs | astray_macro |
version | 0.2.5 |
source | src |
created_at | 2023-02-16 23:15:39.10327 |
updated_at | 2023-07-30 11:03:28.659362 |
description | Easily build AST from Rust structures |
homepage | |
repository | https://www.github.com/giluis/astray.git |
max_upload_size | |
id | 787110 |
size | 26,383 |
-[X] Box -[X] Vec -[ ] Functional Aproach -[ ] Enums with fieldless variants (check Operator @ tests/std_types/box.rs) -[ ] Proper documentation
// /** // * 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))) // * } // * } // */