-
Firstly, thanks for the awesome tool! I've been trying to use the tool to match python code fragments(~5-10 loc), while allowing multiple random statements in between. I've been trying to use the "preceeds" relational rule, along with a "stopBy:end" condition, but that doesn't seem to be working. Here is a link to the playground I've been working with. Here is the code-block I would like to search for
Here are some code-blocks that I would like to match:
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 5 replies
-
Sorry I didn't quite get what your error message means. I guess you want to match a variable that is incremented in a for loop? It it was the case, this playground link should work. rule:
pattern:
context: $COUNT = $_
selector: expression_statement
precedes:
kind: for_statement
has:
pattern: $COUNT += $_
stopBy: end
stopBy: end
|
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Thanks for your replies, they were helpful! This is what I ended up with |
Beta Was this translation helpful? Give feedback.
Thanks for your replies, they were helpful! This is what I ended up with