pre_parse

Function pre_parse 

Source
pub fn pre_parse<'a>(
    tokens: &'a mut [CommentedToken<'a>],
) -> Vec<&'a CommentedToken<'a>>
Expand description

This function aims to squeeze the comments into the tokens, so the parser doesn’t have to worry about comments.

It achieves this by attaching all the comments that precede a token, and the inline comments that follow a token to the token itself. Thus, all the comments are attached to non-comment tokens. The comments are then unfurled in the formatting stage.