It would be nice to be able to use bitflags! and have nice output generated. Ideally the output of macro expansion would just naturally work.
Currently the output of a bitflags! macro is a struct containing an integer, some trait implementations, and an inherent impl that contains the associated constants for each constant from the bitflags! macro.
I believe if we were to parse associated constants and some more trait implementations, the expanded output would work. The associated constants part is a little tricky because the constants are rust structs initializers and not integer literals.
Alternatively, we could parse the bitflags! macro and output some specially crafted output. This may be easier, but I'm not sure yet.
It would be nice to be able to use
bitflags!and have nice output generated. Ideally the output of macro expansion would just naturally work.Currently the output of a
bitflags!macro is a struct containing an integer, some trait implementations, and an inherent impl that contains the associated constants for each constant from thebitflags!macro.I believe if we were to parse associated constants and some more trait implementations, the expanded output would work. The associated constants part is a little tricky because the constants are rust structs initializers and not integer literals.
Alternatively, we could parse the
bitflags!macro and output some specially crafted output. This may be easier, but I'm not sure yet.