Returns a tibble (which is not a valid parse table for
stack = TRUE), with vars and another variable position that denotes
the index each element in the transition. This can be helpful in conjunction
with purrr::pluck() or purrr::modify_in() to reach the terminal in the
nested structure.
Arguments
pd
A nest.
stack
Whether or not to also return information on the tokens that
are between pd and the first terminal, so the returned tibble can be
understood as a transition path from pd to the next terminal, instead of
the information at the terminal only. The order is inside-out,
i.e. the first non-terminal on top, the terminal last.
vars
The variables to return.
tokens_exclude
A vector with tokens to exclude. This can be helpful if
one wants to find the next token that is not a comment for example.