Skip to main content

parse_all_files_cached

Function parse_all_files_cached 

Source
pub fn parse_all_files_cached(
    sources: &[SourceFile<'_>],
    preview_features: &PreviewFeatures,
    cache: &CacheStore,
    build_fp: &CacheKey,
) -> MultiErrorResult<(ParsedProgram, ParseCacheStats)>
Expand description

Run the parse pipeline with cache lookup/store enabled.

Behavior:

  • For each SourceFile, compute parse_key and probe the cache.
  • On hit: deserialize CachedParseOutput, re-intern its snapshot into the build’s shared ThreadedRodeo, and walk the AST to substitute Spurs via the remap. Skip lex+parse for that file.
  • On miss: lex+parse into a fresh per-file interner, snapshot it, store the cached output, then merge into the build interner the same way as a hit (ensuring the merge path is exercised on every build, not just hits).

Returns the parsed program plus per-stage cache stats.