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

"Replace all" elision #10

Open
abhinav opened this issue Apr 21, 2021 · 0 comments
Open

"Replace all" elision #10

abhinav opened this issue Apr 21, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@abhinav
Copy link
Contributor

abhinav commented Apr 21, 2021

Currently, patches with elisions only replace the first instance of the matched contents.

For example,

 f(..., 
-  "GET",
+  constants.Get,
  ...,
 )

This will only replace the first instance in a matching function call.

// Input
foo(a, b, "GET", c, "GET", d)

// Expected
foo(a, b, constants.Get, c, constants.Get, d)

// Actual
foo(a, b, constants.Get, c, "GET", d)

gopatch should either treat ..., foo, ... transformations as "replace all", or we should add support for contextual transformations sooner (#11).

@abhinav abhinav added the enhancement New feature or request label Apr 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

No branches or pull requests

1 participant