proc-macro-rules
proc-macro-rules copied to clipboard
Macro-rules-style syntax matching for procedural macros
looking into how to parse tokens in a proc_macro. how usable would yall say this is? reasonable to pull it in and pull request for issues? update: I went with...
https://github.com/nrc/proc-macro-rules/blob/a39acd952cdf0efe72916fe19439d3ec1a1ea805/examples/macro_rules.rs#L35 There is an example how to write it, but there is no example how to call it in the code.
Following the compiler (looks like this is going to be a very big thing to do). It is necessary to ensure we don't loop forever and maybe to prevent crashes
As well as `ident`, etc., we could support anyt type which implements `Parse`. Would require some design work, I think
Because `macro_rules` does.
some of the names of things could be better
e.g., from the repeat sequence matching
- [ ] - API docs (`rules` macro, `match_set`) - [ ] - comments as needed (at least for each module) - [x] - README - [ ] - tutorial?...
- [x] - collect_vars - [ ] - MatchSet - [ ] - expand? - [x] - smoke tests
We re-compute the variable sets for every sub-rule