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
hello.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
20
33
34
case
OP_RUST_HELLO
: {
35
#ifdef FUN_WITH_RUST
36
const
char
*
s
=
fun_rust_get_string
();
37
if
(!
s
)
s
=
""
;
38
push_value(vm,
make_string
(
s
));
39
#else
40
vm_raise_error
(vm,
"RUST_HELLO requires FUN_WITH_RUST=ON at build time"
);
41
push_value(vm,
make_nil
());
42
#endif
43
break
;
44
}
OP_RUST_HELLO
@ OP_RUST_HELLO
Definition
bytecode.h:278
s
uint32_t s
Definition
rol.c:31
make_nil
Value make_nil(void)
Construct a nil Value.
Definition
value.c:126
make_string
Value make_string(const char *s)
Construct a string Value by duplicating the given C string.
Definition
value.c:95
vm_raise_error
void vm_raise_error(VM *vm, const char *msg)
Raise a runtime error inside the VM, honoring try/catch/finally.
Definition
vm.c:248
fun_rust_get_string
const char * fun_rust_get_string(void)
Generated on
for Fun by
1.16.1