Yes, at the moment I just assume that all atoms are rust idents because that makes it easier to implement (I can just match against $x:ident), so it doesn't support dashes in atoms. I guess you could match against `$x:ident $(- $y:ident)*` instead? That should work I think, I'd have to change some details in some of the arms but it seems like that would be possible.
throwup238|1 year ago
quasigloam|1 year ago
celeritascelery|1 year ago
anothername12|1 year ago
throwup238|1 year ago
You can use proc_macro::Span.line()/column() [1] to track how much whitespace there is between tokens and merge them, but the macro will have to rename them to valid Rust identities ("foo-bar" to "foo_bar") and make sure there's no collisions.
[1] https://doc.rust-lang.org/proc_macro/struct.Span.html#method...