[Rpm-maint] [rpm-software-management/rpm] Forbid 'if' richops in 'or' context and 'unless' richops in 'and' con… (#317)

Michael Schroeder notifications at github.com
Mon Nov 5 22:35:35 UTC 2018


You mean that the check if for RPMRICHOP_IF but the message is about 'unless'? That's because this is not about the current op, but about the context, i.e. the place where RICHPARSE_NO_AND is set. This happens for the 'unless' operator.

I think what's confusing you is that the check bits are set when doing the recursion and tested at the end of the parsing. Say we have `((A unless B) and C)`. At the point where we parse `(A unless B)` we do not know that there will be an `and` following the expression. So what happens is that the `unless` sets the RICHPARSE_NO_AND check so that there is an error if it later turns out that this was an 'and' context.

IIRC I used `op == RPMRICHOP_AND || op == RPMRICHOP_IF` so that the context 'propagates' into the `if` op, i.e. it forbids `((A unless B) if C)`.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/317#issuecomment-436061398
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20181105/1b8d3d5e/attachment-0001.html>


More information about the Rpm-maint mailing list