You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 9, 2021. It is now read-only.
Right now we only have $*<name> to match optional parts.
Sometimes we want to match exactly 1 optional node inside a pattern. It's either nil or it matches exactly 1 node.
It could be used to match optional parts inside a pattern that are expected to represent a single expression (or none).
I don't think that we need more general {min,max} form from regexps, but ? seems useful.
My use case: "find f() function call that is not followed by a return statement".
It could be expressed via f(); $x and then checking that $x is a return statement. The only problem is that f() could be the last statement inside a block.
We could solve that by using f(); $?x query that should in theory match these cases without return as well.
The text was updated successfully, but these errors were encountered:
Right now we only have
$*<name>
to match optional parts.Sometimes we want to match exactly 1 optional node inside a pattern. It's either nil or it matches exactly 1 node.
It could be used to match optional parts inside a pattern that are expected to represent a single expression (or none).
I don't think that we need more general
{min,max}
form from regexps, but?
seems useful.My use case: "find f() function call that is not followed by a return statement".
It could be expressed via
f(); $x
and then checking that$x
is a return statement. The only problem is thatf()
could be the last statement inside a block.We could solve that by using
f(); $?x
query that should in theory match these cases without return as well.The text was updated successfully, but these errors were encountered: