Skip to main content

build_label_index

Function build_label_index 

Source
fn build_label_index(
    document: &Document,
    diagnostics: &mut Vec<Diagnostic>,
) -> BTreeMap<String, LabelTarget>
Expand description

Build the label -> LabelTarget index from every label-declaring block, reporting MOS0030 for redeclarations. The first declaration of a label wins; later occurrences keep their numbering but are not indexed, and each carries a related note pointing at the first declaration plus a structured rename [Suggestion]; the next free {label}-N: over the duplicate label token span (see the module-level docs). Reads the document only, so resolve stays idempotent.