syntax_bridge

Function token_tree_to_syntax_node

Source
pub fn token_tree_to_syntax_node<Ctx>(
    tt: &TopSubtree<SpanData<Ctx>>,
    entry_point: TopEntryPoint,
    span_to_edition: &mut dyn FnMut(Ctx) -> Edition,
    top_edition: Edition,
) -> (Parse<SyntaxNode>, SpanMap<Ctx>)
where Ctx: Copy + Debug + PartialEq + Eq + Hash,
Expand description

Converts a [tt::Subtree] back to a [SyntaxNode]. The produced SpanMap contains a mapping from the syntax nodes offsets to the subtree’s spans.