Skip to main content

Module source_macros

Module source_macros 

Source
Expand description

Build a per-file MacroTable from raw .erl and .hrl source.

Scans the file for -define, -include, and -include_lib attributes and folds resolved header content back in until the include chain stabilises. Cycles are broken by a seen set.

Structs§

FileMap
Convenience wrapper: a flat map from path → file body, with two resolution lookups (relative to the source file, then global).
HeaderBody

Traits§

HeaderResolver
Look up the body of a header by its raw -include(...) or -include_lib(...) argument, given the directory of the source file that named it.

Functions§

build_macro_table
Builds the macro table for source (presumed .erl), resolving included headers through resolver. source_path is the path of the file being analyzed: it’s used as the include-search anchor.