Replies: 3 comments
-
@kvark, thanks for the feedback. For no. 2, I haven't really kept track of proc macro developments as of late, but I'm not completely sure whether there's a way to get the path of the file where the proc macro was invoked so you can do relative inclusion of the file. Once we have this possibility, ideally we would try both relative and cargo root paths:
|
Beta Was this translation helpful? Give feedback.
-
The standard |
Beta Was this translation helpful? Give feedback.
-
Yeah, that'd be great but: A) it's not possible currently. There is no way for a procedural macro to open a path relative to the file that is being expanded for. You can get the manifest directory (and whatever the working directory happens to be; that's not specified and even changed at some point, breaking some macros) and that's it. If I'm wrong, I'd love to be corrected. B) changing the path base is a breaking change, so the current behavior needs to at the very least be supported (potentially with a deprecation warning) once we can act like |
Beta Was this translation helpful? Give feedback.
-
Some things that I found sub-ideal:
#[grammar = "ident.pest"]
appears to be neither from root or local to the file, but instead hardcoded to "$root/src"Rule
comes out of nowhereBeta Was this translation helpful? Give feedback.
All reactions