-
Notifications
You must be signed in to change notification settings - Fork 38
Open
Description
I want to do something like this:
@@
var s, low, up expression
@@
+import "slices"
-s = append(s[:low], s[up:]...)
+s = slices.Delete(s, low, up)
It doesn't work:
load patch "delete.patch": parse: delete.patch/0.minus.augmented:4:27: missing ',' in argument list
Supposably because ... is considered as a hole.
Using identifier instead of s[up:] works correctly, which matches the code
gopatch/internal/pgo/augment/find.go
Lines 178 to 185 in 2ae6b02
| func (f *finder) ident() { | |
| f.next() // IDENT | |
| // foo... | |
| if f.tok == token.ELLIPSIS { | |
| f.next() // leave unchanged | |
| } | |
| } |
I haven't found a quick way to fix this, because it is not obvious what context we need to track and remember.
Metadata
Metadata
Assignees
Labels
No labels