Skip to main content

preprocess

Function preprocess 

Source
pub fn preprocess(
    source: &str,
    source_path: &str,
    resolver: Option<&dyn FileResolver>,
) -> Result<PreprocessResult, PreprocessFailure>
Expand description

Run the full preprocessor pipeline:

  1. Resolve .include directives (flatten files)
  2. Expand .macro/.endm, .rept/.endr, .irp/.endr

The resulting expanded_source can be fed directly to the pest parser. The source_map allows remapping pest error spans back to original locations.