-
Notifications
You must be signed in to change notification settings - Fork 65
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
Action called twice with Memo.no, once with Memo.yes #108
Comments
Actually I think I get what is going on now, maybe I have it wrong way round. The memo'd version after trying the neg look-ahead at the end, already has a match that succeeded, so instead of running the A rule again it grabs it from the memo, so the action doesn't get run again. So now i think both versions should call the action twice because of where it is placed. The memo would need to know about actions then. I'll wait to see what you think. |
Ideally, Or else, I can just put in the docs that expressions used inside lookahead should not have side effects? |
Yeh I probably agree.
If you have a rule on an action, you would then also need a no-action version of it. I think gagging the look-ahead's is better. |
And I guess gagging could be made into a generic mechanism, useful for |
Definitely, I have needed it before, and worked around it with two versions of the same rule. |
I think in this test
action
should only be called once, and with memoization on that is what happens. With memoization off,action
is called twice. I'm not having much luck debugging it.The text was updated successfully, but these errors were encountered: