feat(tvix/compiler): implement || operator
Same dance as `&&` but logically inverted. Change-Id: I213e200e3836527e9abe510f354ee7cd1f70d041 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6151 Tested-by: BuildkiteCI Reviewed-by: grfn <grfn@gws.fyi> Reviewed-by: sterni <sternenseemann@systemli.org>
This commit is contained in:
parent
4b920912b8
commit
c7c7ab9bd4
3 changed files with 29 additions and 6 deletions
|
|
@ -176,6 +176,12 @@ impl VM {
|
|||
self.ip += offset;
|
||||
}
|
||||
|
||||
OpCode::OpJumpIfTrue(offset) => {
|
||||
if self.peek(0).as_bool()? {
|
||||
self.ip += offset;
|
||||
}
|
||||
}
|
||||
|
||||
OpCode::OpJumpIfFalse(offset) => {
|
||||
if !self.peek(0).as_bool()? {
|
||||
self.ip += offset;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue