Skip to main content

parse_cpp_c_reading

Function parse_cpp_c_reading 

Source
pub fn parse_cpp_c_reading<'tree>(
    file: &ProjectFile,
    source: &str,
    root: Node<'tree>,
    ancestry: &ParentIndex<'tree>,
    primary: &ParsedFile,
) -> ParsedFile
Expand description

The C reading of a tree whose other reading is already in hand.

The dialect decides exactly one thing: where a struct/union/enum tag declared inside another aggregate’s member list is declared (the c_tag_semantics readers in crate::declarations). Everything else this file’s extraction produces is a property of the tree and of the source text – the parent index, the #include sweep, the identifier sweep, and the quoted-include line recovery – so the C reading takes those from primary rather than recomputing them over the same bytes. A debug build re-runs the sweeps and asserts they agree, which is what holds the claim honest if a future walk ever starts contributing to one of those families.