Skip to main content

Module hir_ext

Module hir_ext 

Source
Expand description

HIR-aware enrichments.

Pure functions over solar’s HIR:

  • build_name_to_page: maps contract names to their MDX page paths.
  • inheritance_links: **Inherits:** line for a contract page.
  • natspec_doc: resolves effective NatSpec for a callable item.
  • replace_inline_links: rewrites {Ident} to markdown links.

StructsΒ§

GetterField
One rendered row of a public variable getter signature (its name, ABI type and the inherited description).
LocalMembers
Members of the contract page currently being rendered.
NameToPage
Maps Solidity identifiers and HIR ids to their output MDX page paths relative to pages/.
NatSpecDoc
Effective NatSpec for an item, resolved by Solar and aligned with the item’s callable signature.

EnumsΒ§

InheritedContract πŸ”’

FunctionsΒ§

build_name_to_page
Build the NameToPage index from HIR by re-deriving each item’s output path.
callable_function πŸ”’
clean_block_doc_content πŸ”’
Strip the * block-comment line decoration from each line of a /** */ NatSpec item’s content. Solar preserves raw source bytes, so continuation lines look like * text and blank separator lines look like *. This normalises them to plain text / empty lines.
continuation_parent πŸ”’
Returns the original tagged parent of a synthetic line-comment notice. The outer Option distinguishes a continuation from a standalone untagged notice; the inner value is None when Solar’s resolved view omitted the parent because a local section replaced it.
direct_base_items πŸ”’
doc_from_view πŸ”’
effective_natspec_doc πŸ”’
empty_natspec_doc πŸ”’
escape_link_label πŸ”’
Escape a string for use as a markdown link label.
exact_override_item πŸ”’
function_signature_anchor πŸ”’
function_source_param_types πŸ”’
Extracts function parameter types exactly as spelled in source for link anchors.
getter_field πŸ”’
implicit_edge_compatible πŸ”’
inheritance_links
Returns the **Inherits:** markdown string for a contract, or None if it has no bases.
insert_function_anchors πŸ”’
Record the heading and exact signature anchor for a rendered Solidity function.
natspec_doc
Resolves explicit NatSpec inheritance, or Foundry’s conservative implicit inheritance policy.
normalize_sol_type πŸ”’
Canonicalizes Solidity type aliases for generated link anchors.
normalized_natspec_content πŸ”’
page_link πŸ”’
Produce a vocs-style link from page relative to current_page.
parameter_names_equal πŸ”’
parse_inline_link πŸ”’
Parse {[xref-]Ident[-part]}[label] starting at offset 0 in s.
positional_description πŸ”’
push_non_yul_base_items πŸ”’
render_ty πŸ”’
Renders a resolved type as its ABI signature string.
replace_inline_links
Replace {Ident} and {xref-Ident} with markdown links using name_to_page.
resolve_page πŸ”’
Pick the best candidate page for a given cross-reference lookup.
slug_anchor_segment πŸ”’
source_paths πŸ”’
xref_part_anchor πŸ”’