mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-29 14:54:47 +00:00
add Bool.not
This commit is contained in:
parent
08403b0a1f
commit
1108e56750
1 changed files with 10 additions and 0 deletions
|
@ -161,6 +161,16 @@ pub fn build_expr<'a, 'ctx, 'env>(
|
|||
|
||||
build_basic_phi2(env, parent, comparison, build_then, build_else, ret_type)
|
||||
}
|
||||
Symbol::BOOL_NOT => {
|
||||
// The (!) operator
|
||||
debug_assert!(args.len() == 1);
|
||||
|
||||
let arg = build_expr(env, scope, parent, &args[0].0, procs);
|
||||
|
||||
let int_val = env.builder.build_not(arg.into_int_value(), "bool_not");
|
||||
|
||||
BasicValueEnum::IntValue(int_val)
|
||||
}
|
||||
_ => {
|
||||
let mut arg_tuples: Vec<(BasicValueEnum, &'a Layout<'a>)> =
|
||||
Vec::with_capacity_in(args.len(), env.arena);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue