Expand description
Include handling: parse files and build a tree of (path, source, AST) with circular include detection.
Paths are resolved relative to the directory of the current file (or the current working directory when parsing from stdin). Circular includes are detected and reported as errors. No source expansion: each file keeps its own AST.
Structs§
- Include
Tree - One file in the include tree: path, source, parsed root, and parsed included files in order.
Enums§
- Include
Error - Error from the include preprocessor.
Functions§
- all_
files - Flatten the tree into (path, source) for all files (root first, then includes depth-first).
- build_
include_ tree - Build the include tree: parse
sourceas the main file, resolve eachinclude("path"), load and parse those files (with circular include detection), and return the tree. - collect_
include_ path_ ranges - Collect (
start_byte,end_byte,path_string) for eachinclude("...")in the file. Used by the LSP to provide document links and go-to-definition on include paths.