Fun 0.41.5
The programming language that makes you have fun!
Loading...
Searching...
No Matches
repl.h
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
10/**
11 * @file repl.h
12 * @brief Interactive Read-Eval-Print Loop (REPL) entry point.
13 */
14#ifndef FUN_REPL_H
15#define FUN_REPL_H
16
17#include "vm.h"
18
19#ifdef __cplusplus
20extern "C" {
21#endif
22
23#ifdef FUN_WITH_REPL
24/**
25 * @brief Run the interactive REPL using an already-initialized VM.
26 *
27 * Reads lines from stdin, evaluates them in the provided VM context, and
28 * prints results/errors. The function returns on EOF or when the user issues
29 * a quit command supported by the REPL implementation.
30 *
31 * @param vm Pointer to an initialized VM; must not be NULL.
32 * @return 0 on normal exit, non-zero on fatal error.
33 */
34int fun_run_repl(VM *vm);
35#endif
36
37#ifdef __cplusplus
38} // extern "C"
39#endif
40
41#endif // FUN_REPL_H
int fun_run_repl(VM *vm)
Run the interactive REPL using an already-initialized VM.
Definition repl.c:1310
The Fun virtual machine state.
Definition vm.h:110
Core virtual machine data structures and public VM API.