Fun 0.41.5
The programming language that makes You have fun
Loading...
Searching...
No Matches
repl.c File Reference

Interactive Read–Eval–Print Loop (REPL) for the Fun language. More...

#include "repl.h"
#include "bytecode.h"
#include "parser.h"
#include "value.h"
#include "vm.h"
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <dirent.h>
#include <limits.h>
#include <sys/stat.h>
#include <termios.h>
#include <unistd.h>
Include dependency graph for repl.c:

Go to the source code of this file.

Functions

int map_expanded_line_to_include_path (const char *path, int line, char *out_path, size_t out_path_cap, int *out_line)
 Map a line number in expanded source back to original include path/line.

Detailed Description

Interactive Read–Eval–Print Loop (REPL) for the Fun language.

Provides line editing, history, simple completion for :load paths and stdlib identifiers, multi-line input heuristics, and a command interface (e.g. :help, :env, :load). Built only when FUN_WITH_REPL is defined.

Definition in file repl.c.

Function Documentation

◆ map_expanded_line_to_include_path()

int map_expanded_line_to_include_path(const char *path,
intline,
char *out_path,
size_tout_path_cap,
int *out_line )
extern

Map a line number in expanded source back to original include path/line.

Scans the expanded text for the nearest preceding __include_begin__ marker and computes the corresponding inner line number.

Parameters
pathPath to the original top-level file that was expanded.
line1-based line number in the expanded text.
out_pathOutput buffer for the resolved file path.
out_path_capCapacity of out_path.
out_lineReceives 1-based line number within resolved file.
Returns
1 on success, 0 on failure.

Definition at line 996 of file parser_utils.c.