Skip to main content

parse_via_cst_opts

Function parse_via_cst_opts 

Source
pub fn parse_via_cst_opts(
    source: &str,
    collect_occurrences: bool,
) -> ParseResult
Expand description

Like parse_via_cst, but only collects currency_occurrences / account_occurrences when collect_occurrences is true.

Those two indices are consumed solely by the LSP (rename / references / highlight). The loader / CLI processing path never reads them, so passing false skips the per-ACCOUNT/CURRENCY Account::new / Currency::new construction and the per-token in-ERROR_NODE ancestor walk inside walk_descendants_once — profiling flagged that walk as the #1 allocation-count site. Inline errors and top-level comments are still collected unconditionally (the processing path needs them).