feat(tvix/eval): Support builtins.bitXor
Bitwise "exclusive-or" on integers. Change-Id: I90a0a15afb3a58662d70e82ea14e48b877476e04 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6550 Autosubmit: wpcarro <wpcarro@gmail.com> Reviewed-by: wpcarro <wpcarro@gmail.com> Reviewed-by: tazjin <tazjin@tvl.su> Tested-by: BuildkiteCI
This commit is contained in:
parent
031ca653a3
commit
f859751c6a
3 changed files with 20 additions and 0 deletions
|
|
@ -115,6 +115,13 @@ fn pure_builtins() -> Vec<Builtin> {
|
|||
})
|
||||
})
|
||||
}),
|
||||
Builtin::new("bitXor", 2, |args, vm| {
|
||||
force!(vm, &args[0], x, {
|
||||
force!(vm, &args[1], y, {
|
||||
Ok(Value::Integer(x.as_int()? ^ y.as_int()?))
|
||||
})
|
||||
})
|
||||
}),
|
||||
Builtin::new("catAttrs", 2, |mut args, _| {
|
||||
let list = args.pop().unwrap().to_list()?;
|
||||
let key = args.pop().unwrap().to_str()?;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue