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_standard_json_input
Build the --standard-json input for solc.
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).
version_satisfies
Check if a version satisfies a pragma constraint.