Skip to main content

parse_cpp_file_in_dialect

Function parse_cpp_file_in_dialect 

Source
pub fn parse_cpp_file_in_dialect(
    file: &ProjectFile,
    source: &str,
    tree: &Tree,
    dialect: LanguageDialect,
) -> ParsedFile
Expand description

Extract file under an explicitly named dialect.

A header carries no compilation language of its own, so its blob has two legitimate readings: under LanguageDialect::CppC a tag declared inside an aggregate member list has file scope (C17 6.2.1), under the plain C++ dialect it is a nested class. Milestone 3 of .agents/plans/c-compilation-language-tag-scope.md stores both readings of a header when they differ, so extraction has to be reachable under a dialect the path itself does not name.

This entry point owns the whole tree’s work, including the parent index the walk asks its ancestor questions of. A caller that wants both readings of one tree must use parse_cpp_file_with_ancestry and parse_cpp_c_reading instead, which share that index.