diff options
author | Ashelyn Rose <git@ashen.earth> | 2025-04-20 11:49:00 -0600 |
---|---|---|
committer | Ashelyn Rose <git@ashen.earth> | 2025-04-20 11:49:00 -0600 |
commit | b115605055e72c5a261f9f024d7db8f508517fc9 (patch) | |
tree | 294484b761030772ea3fadeb3a22ae3688528b80 /modules/morgana_proc/src | |
parent | 55dd47aff347ee882f375b5cf880a299e633f556 (diff) |
Started proc_macro parsing - DOES NOT WORK
Diffstat (limited to 'modules/morgana_proc/src')
-rw-r--r-- | modules/morgana_proc/src/lib.rs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/modules/morgana_proc/src/lib.rs b/modules/morgana_proc/src/lib.rs new file mode 100644 index 0000000..f4932d6 --- /dev/null +++ b/modules/morgana_proc/src/lib.rs @@ -0,0 +1,21 @@ +extern crate proc_macro; + +use unsynn::*; + +#[proc_macro] +pub fn morx(input: proc_macro::TokenStream) -> proc_macro::TokenStream { + println!("{:?}", input); + let ast: MorxBlock = unsynn::TokenStream::from(input).to_token_iter().parse_all().unwrap(); + + LiteralString::from_str("test").to_token_stream().into() +} + + +unsynn! { + struct MorxBlock(Any<Either<Literal, Box<MorxNode>>, Nothing>); + struct MorxNode(Ident, MorxChildren); + struct MorxAttr(Either<Ident, MorxComplexAttr>); + struct MorxComplexAttr(Ident, Assign, AttrValue); + struct AttrValue(Either<Ident, Literal, BracketGroup>); + struct MorxChildren(Either<EndOfStream, Semicolon, BracketGroupContaining<Box<MorxBlock>>>); +} |