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

Fix @filter behavior in phpgrep rules #1200

Open
quasilyte opened this issue Oct 11, 2022 · 0 comments
Open

Fix @filter behavior in phpgrep rules #1200

quasilyte opened this issue Oct 11, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@quasilyte
Copy link
Contributor

dynamic rules @filter should work like phpgrep CLI filters.

What should be changed:

  1. There should be no restrictions on the variable expression. ${"x:const"} should work as well as $x; the :const part specifies the node class
  2. When matching, $x with a filter should not be limited to variables; $x matches anything in phpgrep. Instead of matching by variable name after a type assertion, a text slice should be taken using the $x node position info (it has begin+end positions). We usually have the current file source available during the analysis as []byte.
@quasilyte quasilyte added the bug Something isn't working label Oct 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant