Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: re-use $... meta variable in rewrite expression #251

Open
jonathan-s opened this issue Apr 17, 2024 · 2 comments
Open

Feature request: re-use $... meta variable in rewrite expression #251

jonathan-s opened this issue Apr 17, 2024 · 2 comments

Comments

@jonathan-s
Copy link

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
Copy link
Contributor

ilevyor commented Apr 17, 2024

$... 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

@ilevyor ilevyor self-assigned this Apr 17, 2024
@jonathan-s
Copy link
Author

That would be lovely!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants