biscuit-auth/biscuit-rust

Expression: Negate: drop int support

Closed this issue · 1 comments

Integer support for the unary Negate operation can probably be dropped, as integers are already signed and can be multiplied by -1 to negate them.

On the parser side, it only accept negating integers right now (parsing "-" <int>). The "-" sign should probably be part of a parsed integer instead of the negate operation, and the operation could then parse a boolean negation like "!" <bool>

Geal commented

fixed in bdc58ab
I'm a bit worried about printing here, since it's possible to have $0, $1, And, Negate that will be interpreted as !($0 && $1) but printed as !$0 && $1. So I'll have to rewrite parts of the printer