Skip to main content

build_parse_only_json_input

Function build_parse_only_json_input 

Source
pub fn build_parse_only_json_input(
    source_files: &[PathBuf],
    remappings: &[String],
    config: &FoundryConfig,
) -> Value
Expand description

Build a parse-only standard-json input (stopAfter: "parsing").

Unlike the full batch input this mode stops before import resolution and type-checking. That means:

  • No version 5333 errors cascade from imported incompatible files — the compatible files are NOT fetched from disk as imports.
  • The resulting ASTs contain all declaration nodes and local referencedDeclaration IDs but not cross-file resolved IDs.
  • Only ast output is requested; contract outputs (abi, gas …) are omitted because they require type-checking.

This is used for the compatible-file batch in the mixed-version project index so we can get parse-time ASTs for all project/lib files that satisfy the project pragma, without being blocked by imports into incompatible lib files.