You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 12, 2023. It is now read-only.
I believe it should be possible to use chumsky to interpret the tokens of a proc macro. I think that chumsky's API, with the use of parser combinators, can allow for much more concise code for XRBK macro with much faster prototyping/syntax changes. I also think it can allow for much easier recovery for errors (e.g. if a reply has no #[sequence] attribute).
My rough understanding from ~15 minutes of research is that chumsky can be used where:
syntax errors to do with XRBK macro's syntax are emitted instead of the output, turned into a compile_error!(...) macro invocation (unresolved question: what happens if you generate the output which could be recovered as well as putting the compile_error!(...) in the place where the error is? could an IDE still provide suggestions for the other code in that case?).
syntax errors in normal Rust syntax are completely recovered, with the invalid Rust syntax being output. This is so the existing Rust tools can handle those errors properly, which they can do better than XRBK macro would be able to do with just a compile_error!(...) invocation.