-
-
Notifications
You must be signed in to change notification settings - Fork 932
Closed
Labels
C-enhancementCategory - New feature or requestCategory - New feature or request
Description
There's situiation that we need turn a identifier a into various form depend on the conditions. And we want to apply the span of a to the final form. The current solution make it complex to do it.
let span_of_a = a.span;
let expr = if rewrite_to_member_expr {
member_expr!(a, SPAN)
} else {
a
}
let expr = if is_callee {
member_expr_again!(expr, SPAN)
} else {
expr
};
expr.span = span_of_a;You will see we have to apply the span of a in the end, otherwise the sourcemap might be wrong, which is caused by nested ast nodes have the same span. I guess this is allowed maybe? But it's doesn't generate accurate sourcemap.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
C-enhancementCategory - New feature or requestCategory - New feature or request
Type
Fields
Give feedbackPriority
None yet