![]() | Fun 0.41.5 The programming language that makes You have fun |
Low-level parsing helpers and include preprocessor for the Fun parser. More...


Go to the source code of this file.
Data Structures | |
| struct | StrBuf |
| Simple growable string buffer. More... | |
| struct | NameList |
| List of exported symbol names discovered at top level. More... | |
Macros | |
| #define | DEFAULT_LIB_DIR "/usr/share/fun/lib/" |
Functions | |
| char * | preprocess_includes (const char *src) |
| Public wrapper to preprocess includes without a current path. | |
| char * | preprocess_includes_with_path (const char *src, const char *current_path) |
| Preprocess includes with a known file path to improve span markers. | |
| 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. | |
Low-level parsing helpers and include preprocessor for the Fun parser.
This module provides character scanners, token helpers, simple string/number literal readers, a lightweight include preprocessor that can expand include directives, and mapping utilities to translate expanded line numbers back to original files for diagnostics.
Definition in file parser_utils.c.
| #define DEFAULT_LIB_DIR "/usr/share/fun/lib/" |
| 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.
Scans the expanded text for the nearest preceding __include_begin__ marker and computes the corresponding inner line number.
| path | Path to the original top-level file that was expanded. |
| line | 1-based line number in the expanded text. |
| out_path | Output buffer for the resolved file path. |
| out_path_cap | Capacity of out_path. |
| out_line | Receives 1-based line number within resolved file. |
Definition at line 996 of file parser_utils.c.

| char * preprocess_includes | ( | const char * | src | ) |
Public wrapper to preprocess includes without a current path.
Definition at line 965 of file parser_utils.c.

| char * preprocess_includes_with_path | ( | const char * | src, |
| const char * | current_path ) |
Preprocess includes with a known file path to improve span markers.
Definition at line 973 of file parser_utils.c.
