Add a Boolean "not" operator.

Not wholly convinced this is a good idea, maybe "not" should be a
builtin function instead? 'not (.a == .b)' vs. '.a == .b | not'
This commit is contained in:
Stephen Dolan committed 2012-09-04 20:43:40 +01:00
1 parent 6e6ea50763
commit da5d653de8
5 files changed
+16 -1

No files matched your search

+5 -1
View File
@@ -383,7 +383,11 @@ block gen_or(block a, block b) {
block_append(&code, gen_condbranch(block_join(gen_op_simple(POP), gen_op_const(LOADK, jv_true())),
if_a_false));
return code;
}
block gen_not(block a) {
return block_join(a, gen_condbranch(gen_op_const(LOADK, jv_false()),
gen_op_const(LOADK, jv_true())));
}
block gen_cond(block cond, block iftrue, block iffalse) {