Skip to main content

Module solc

Module solc 

Source
Expand description

Direct solc --standard-json runner for fast AST generation.

The output is normalized into the same shape that forge build --json --ast produces, so all downstream consumers (goto, hover, completions, etc.) work unchanged.

Structs§

SemVer
A parsed semver version (major.minor.patch).

Enums§

PragmaConstraint
A version constraint from pragma solidity.

Functions§

build_batch_standard_json_input
Build a --standard-json input that compiles all given source files at once.
build_batch_standard_json_input_ast_only
Build an AST-only batch standard-json input for sub-cache builds.
build_batch_standard_json_input_with_cache
Build a batch standard-json input for solc.
build_parse_only_json_input
Build a parse-only standard-json input (stopAfter: "parsing").
build_standard_json_input
Build the --standard-json input for solc.
discover_compilation_closure
Discover the true compilation closure by tracing imports from the project’s own source files (src/, test/, script/, and any other non-lib top-level directories).
discover_source_files
Discover all Solidity source files under the project root.
discover_source_files_with_libs
Discover source files including library directories.
discover_src_only_closure
Discover the compilation closure seeded only from src files.
discover_src_only_files
Discover only the src directory files (no test, no script).
find_matching_version
Find the best matching installed version for a pragma constraint.
list_installed_versions
List installed solc versions (cached — use get_installed_versions() internally).
normalize_forge_output
Normalize forge build --json --ast output into the canonical shape.
normalize_solc_output
Normalize raw solc --standard-json output into the canonical shape.
parse_pragma
Parse pragma solidity <constraint>; from Solidity source.
resolve_remappings
Fetch remappings by running forge remappings in the project root.
resolve_solc_binary
Resolve the path to the solc binary.
run_solc
Run solc --standard-json and return the parsed output.
solc_ast
Run solc for a file and return normalized output.
solc_build
Run solc for build diagnostics (same output, just used for error extraction).
solc_project_index
Run a project-wide solc compilation and return normalized output.
solc_project_index_ast_only
AST-only project index for sub-cache builds.
solc_project_index_scoped
Run a scoped project-index compile over a selected file list.
version_satisfies
Check if a version satisfies a pragma constraint.