Fun 0.41.5
The programming language that makes You have fun
Loading...
Searching...
No Matches
hello_args.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
35#ifdef FUN_WITH_RUST
36 Value vmsg = pop_value(vm);
37 char *msg = value_to_string_alloc(&vmsg);
38 free_value(vmsg);
39 if (msg) {
41 free(msg);
42 } else {
44 }
45 push_value(vm, make_nil());
46#else
47 /* Still pop and free the arg to keep stack sane */
48 Value vmsg = pop_value(vm);
49 free_value(vmsg);
50 vm_raise_error(vm, "RUST_HELLO_ARGS requires FUN_WITH_RUST=ON at build time");
52#endif
53 break;
54}
@ OP_RUST_HELLO_ARGS
Definition bytecode.h:279
push_value(vm, make_nil())
free_value(vmsg)
vm_raise_error(vm, "RUST_HELLO_ARGS requires FUN_WITH_RUST=ON at build time")
free(vals)
Tagged union representing a Fun value.
Definition value.h:68
Value make_nil(void)
Construct a nil Value.
Definition value.c:126
char * value_to_string_alloc(const Value *v)
Allocate a printable C string for a Value.
Definition value.c:641
int fun_rust_print_string(const char *msg)