Fun
0.41.5
The programming language that makes You have fun
Main Page
Data Structures
Files
File List
Globals
Loading...
Searching...
No Matches
src
vm
logic
and.c
Go to the documentation of this file.
1
/*
2
* This file is part of the Fun programming language.
3
* https://fun-lang.xyz/
4
*
5
* Copyright 2025 Johannes Findeisen <you@hanez.org>
6
* Licensed under the terms of the Apache-2.0 license.
7
* https://opensource.org/license/apache-2-0
8
*/
9
30
31
case
OP_AND
: {
32
Value
b
= pop_value(vm);
33
Value
a
= pop_value(vm);
34
int
res
=
value_is_truthy
(&
a
) &&
value_is_truthy
(&
b
);
35
free_value
(
a
);
36
free_value
(
b
);
37
push_value
(vm,
make_bool
(
res
));
38
break
;
39
}
a
Value a
Definition
add.c:37
free_value
free_value(a)
res
int res
Definition
and.c:34
push_value
push_value(vm, make_bool(res))
b
uint32_t b
Definition
band.c:32
OP_AND
@ OP_AND
Definition
bytecode.h:71
Value
Tagged union representing a Fun value.
Definition
value.h:68
value_is_truthy
int value_is_truthy(const Value *v)
Evaluate a Value's truthiness according to Fun language rules.
Definition
value.c:610
make_bool
Value make_bool(int v)
Construct a boolean Value.
Definition
value.c:79
Generated on
for Fun by
1.16.1