-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Description
This seems highly desirable for cargo crev's use case.
From each syn::ItemMod that gets parsed, you can find the Span of the semicolon and use Span::start from proc-macro2's "span-locations" feature to figure out the input file line and column of the semicolon. Then you can replace that semicolon character in the original source string with a set of braces containing an indented content of the child module. The final output would be a string of source code rather than syn::File, which the caller can parse to syn::File if they want.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels