pub type TopSubtreeBuilder = TopSubtreeBuilder<SpanData<SyntaxContext>>;
Aliased Type§
struct TopSubtreeBuilder { /* private fields */ }
Implementations
§impl<S> TopSubtreeBuilder<S>where
S: Copy,
impl<S> TopSubtreeBuilder<S>where
S: Copy,
pub fn new(top_delimiter: Delimiter<S>) -> TopSubtreeBuilder<S>
pub fn open(&mut self, delimiter_kind: DelimiterKind, open_span: S)
pub fn close(&mut self, close_span: S)
pub fn remove_last_subtree_if_invisible(&mut self)
pub fn remove_last_subtree_if_invisible(&mut self)
You cannot call this consecutively, it will only work once after close.
pub fn push(&mut self, leaf: Leaf<S>)
pub fn extend(&mut self, leaves: impl IntoIterator<Item = Leaf<S>>)
pub fn extend_tt_dangerous(
&mut self,
tt: impl IntoIterator<Item = TokenTree<S>>,
)
pub fn extend_tt_dangerous( &mut self, tt: impl IntoIterator<Item = TokenTree<S>>, )
This does not check the token trees are valid, beware!
pub fn extend_with_tt(&mut self, tt: TokenTreesView<'_, S>)
pub fn extend_with_tt_alone(&mut self, tt: TokenTreesView<'_, S>)
pub fn extend_with_tt_alone(&mut self, tt: TokenTreesView<'_, S>)
Like [Self::extend_with_tt()
], but makes sure the new tokens will never be
joint with whatever comes after them.
pub fn expected_delimiters(&self) -> impl Iterator<Item = &Delimiter<S>>
pub fn build_skip_top_subtree(self) -> TopSubtree<S>
pub fn build_skip_top_subtree(self) -> TopSubtree<S>
Builds, and remove the top subtree if it has only one subtree child.