-
Notifications
You must be signed in to change notification settings - Fork 38
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
Capture variables from successful combination of sub-matches #65
Comments
sorry for the long inattention. This is a really good question. I don't know how to achieve this with the current set of rules. The requirement is that a rule would have to be matched one-or-more times, like the If I were to address this, I'd probably add Line 56 in e63a164
|
But I'm not sure that would really solve your problem, because if you wrote patterns: const std::string check = R"(
CHECK: [[END:%\w+]] = OpVariable
CHECK-LAST: [[LOADED:%\w+]] = OpLoad %int %n
CHECK: OpStore [[END]] [[LOADED]]
)"; then it would fail if presented with input:
|
You're a gentleman, David - thank you for responding, regardless. It was a really interesting problem, at the time - from memory, I believe we managed to find a way to make things work(ish) with Perhaps, some kind of Happy to close now, unless you want to keep open for future work. |
Thanks. Let's keep this open. Clearly we don't update this much (a.k.a. "it's stable and does its job"), but I'd like to keep the idea around. |
Hi there (cross-post from re2),
Hopefully not a silly question, but is there a way to capture the variables of all possible matches and perform checks with them?
For example, if I use the following made-up SPIR-V:
...the following checks will return
false
......despite
OpStore %end %16
being a possibility.Is there a better syntactical way to capture all possible versions of what
LOADED
might be and return success if a match is found with one of these versions (instead of stopping after the first match)?The text was updated successfully, but these errors were encountered: