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
rust
set_exit.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 2026 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
19
33
case
OP_RUST_SET_EXIT
: {
34
#ifdef FUN_WITH_RUST
35
extern
int
fun_op_rset_exit
(
VM
* vm);
36
/* Expect an integer on the stack already (produced by prior ops) */
37
/* fun_op_rset_exit will pop it and store into vm.exit_code */
38
int
rc
=
fun_op_rset_exit
(vm);
39
(void)
rc
;
40
/* push Nil as a conventional result */
41
push_value
(vm,
make_nil
());
42
#else
43
/* pop and ignore to keep stack sane */
44
Value
v
= pop_value(vm);
45
free_value
(
v
);
46
vm_raise_error
(vm,
"RUST_SET_EXIT requires FUN_WITH_RUST=ON at build time"
);
47
push_value
(vm,
make_nil
());
48
#endif
49
break
;
50
}
OP_RUST_SET_EXIT
@ OP_RUST_SET_EXIT
Definition
bytecode.h:282
v
Value v
Definition
cast.c:22
rc
int rc
Definition
fd_poll_read.c:26
push_value
push_value(vm, make_nil())
vm_raise_error
vm_raise_error(vm, "RUST_SET_EXIT requires FUN_WITH_RUST=ON at build time")
free_value
free_value(v)
VM
The Fun virtual machine state.
Definition
vm.h:110
Value
Tagged union representing a Fun value.
Definition
value.h:68
make_nil
Value make_nil(void)
Construct a nil Value.
Definition
value.c:126
fun_op_rset_exit
int fun_op_rset_exit(VM *vm)
Generated on
for Fun by
1.16.1