-
Notifications
You must be signed in to change notification settings - Fork 22
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
Add @cond
command
#105
Add @cond
command
#105
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #105 +/- ##
==========================================
+ Coverage 75.39% 75.53% +0.14%
==========================================
Files 1 1
Lines 382 421 +39
==========================================
+ Hits 288 318 +30
- Misses 94 103 +9 ☔ View full report in Codecov by Sentry. |
Thanks for this (and sorry for the delay in reviewing this)! I added a test for this, so no need to worry about that from your end :) |
Oh, thanks a lot for accepting the PR! |
Btw, I also added a note in the docs that this only takes local variables into account. Not sure how prohibitive the overhead of doing the eval at infiltration time would be, but that would solve the "issue". |
That's a really cool feature! Thanks for adding it! |
Add a
@cond
command to register an expression at the current infiltration point. The next time that point is hit, infiltration will occur only if the expression evaluates totrue
. This is less efficient than the@infiltrate cond
macro, but is more flexible in that the condition can be updated dynamically.Example:
I'll add some tests if this seems worthwhile to eventually merge.