I learned just enough Rust to do something simple and possibly (maybe) just a little bit useful.
I added True and False conditions that are always true and false.
The most useful thing is that it allows you to have an (else? ...) final branch that is always taken.
I did my best in terms of responsible PR, feel free to send it back for changes if you don't like something (or don't outright reject it, which is also fine :p)
Cool, else is useful. The compiler could emit a warning if else is not the last branch, since in that case it won't work (or will - depends how you look at it).
No problem with never, but I also see no use for it...
Idk about always, it's not very useful, and seems to evoke something like "finally" - to run always. Which it obviously does not, since there is no fall-through between the branches.
What I don't like is true and false - because there are instructions that write a truthy value as 0 or 1 to the output register (e.g. sc-mbtn, sc-key, maybe others). Logically true should be an alias of "not zero" and false of "zero"?
Okay, that all makes sense. I started out wanting else, but when I saw how the others were implemented it made more sense to me to do it like this because it needs an opposite for not.
Is there a more sensible way to do this rather than it being a cond?
Oh, you're right.
I'd do it like this then:
Cond::True ... parsed from "else", and only documented as "else"
Cond::False ... not parsed and not documented (or called "never"), only to satisfy Not