Feature request: re-use `$...` meta variable in rewrite expression
jonathan-s opened this issue · comments
Jonathan Sundqvist commented
Since the $...
expression can capture a number of nodes it would be useful if this could in one way or another be re-used in the re-write expression.
Right now the docs say "Spread metavariables are anonymous, so they cannot be bound to a name.", so anything captured there can't really be used.
The workaround I guess would be to use regex patterns.
ilevyor commented
$...
on its own doesn't have a name, so it wouldn't be possible to bind them with the current syntax, I don't think it would be too hard to add something like $...name
where $name
binds to whatever $...
would have matched
Jonathan Sundqvist commented
That would be lovely!