Fun 0.41.5
The programming language that makes You have fun
Loading...
Searching...
No Matches
to_string.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
39
41 Value v = pop_value(vm);
43 Value out = make_string(s ? s : "");
44 if (s) free(s);
46 push_value(vm, out);
47 break;
48}
Value out
Definition apop.c:38
@ OP_TO_STRING
Definition bytecode.h:94
Value v
Definition cast.c:22
free(vals)
uint32_t s
Definition rol.c:31
Tagged union representing a Fun value.
Definition value.h:68
Value make_string(const char *s)
Construct a string Value by duplicating the given C string.
Definition value.c:95
void free_value(Value v)
Free dynamic storage owned by a Value.
Definition value.c:517
char * value_to_string_alloc(const Value *v)
Allocate a printable C string for a Value.
Definition value.c:641