PoignardAzur / venial

"A very small syn"
MIT License
192 stars 9 forks source link

Implement `span()` for each struct #46

Closed rambip closed 8 months ago

rambip commented 1 year ago

I really appreciate your work: the library is really clean and the user is not lost in details.

There is one feature missing I think: your structs don't have span methods

Say I want to create a macro to read unit_tests. While parsing, I read #[no_mangle], but this keyword is not legal here. I would like to report an error to the user, saying "the attribute no_mangle is not allowed", and with the right span.

It would be really nice !

PoignardAzur commented 8 months ago

It's been a while since I've looked at macro code, but I think you can make these error messages using the ToTokens implementations? Do you specifically need a span() method?