Open mikesherov opened 10 years ago
I wan to transform the following:
a.fn(b, c); a.fn(b); a.fn();
to
fn2(a, b, c); fn2(a, b); fn2(a);
In order to do so, I attempted the following grasp command:
grasp "call! > member[prop.name=fn] " -R "fn2({{.args | prepend .callee.obj | join ', '}})"
however, this results in:
fn2(.callee.obj, b, c); fn2(.callee.obj, b); fn2(.callee.obj);
i.e. it used .callee.obj as a string literal when I intended a named submatch. Can there be a way to provide named submatches as arguments to filters?
.callee.obj
I wan to transform the following:
to
In order to do so, I attempted the following grasp command:
however, this results in:
i.e. it used
.callee.obj
as a string literal when I intended a named submatch. Can there be a way to provide named submatches as arguments to filters?