fxrecord/libfxrecord_macros
Barret Rennie ba32575185
Rewrite `impl_message!` as a proc macro
The new message implementation macro, `message_ty!`, is written as a
procedural macro to make the maintenance burden easier. Declarative
macros may be conceptually simpler, but attempting to make
`impl_message!` work for either `struct` or `enum` members was *hard*
and got very messy very fast.

Additionally [rust#22694][rust22694] prevents using declarative macros
to generate item fragments (e.g., enum variants inside `enum Foo {}`),
which makes creating a maintainable decl macro quite hard.

It ended up being less effort to both rewrite it as a proc macro and
also add support for `enum` members. As a side effect, this macro
provides better error spans when it is provided with invalid input
(instead of the generic `no rules expected the token {token}` error).

[rust22694]: https://github.com/rust-lang/rust/issues/22694
2020-07-22 17:16:39 -04:00
..
src Rewrite `impl_message!` as a proc macro 2020-07-22 17:16:39 -04:00
Cargo.toml Rewrite `impl_message!` as a proc macro 2020-07-22 17:16:39 -04:00