// We divide trivia into "leading" and "trailing" trivia of an associated
// token. This means that we must find a dividing line between the trailing trivia
// following one token and the leading trivia of the following token. Plainly
// we need only find this line while scanning trailing trivia. The heuristics
// we use are:
// * The first newline trivia encountered is the last trailing trivia.
// * The newline which follows a // or # comment is not part of the comment
//   but does terminate the trailing trivia.
// * A pragma to turn checks off (HH_FIXME and HH_IGNORE_ERROR) is
//   always a leading trivia.
We divide trivia into "leading" and "trailing" trivia of an associated
token. This means that we must find a dividing line between the trailing trivia
following one token and the leading trivia of the following token. Plainly
we need only find this line while scanning trailing trivia. The heuristics
we use are:
The first newline trivia encountered is the last trailing trivia.
The newline which follows a // or # comment is not part of the comment
but does terminate the trailing trivia.
A pragma to turn checks off (HH_FIXME and HH_IGNORE_ERROR) is
always a leading trivia.
We divide trivia into " leading " and " trailing " trivia of an associated token . This means that we must find a dividing line between the trailing trivia following one token and the leading trivia of the following token . Plainly we need only find this line while scanning trailing trivia . The heuristics we use are : The first newline trivia encountered is the last trailing trivia . The newline which follows a // or # comment is not part of the comment but does terminate the trailing trivia . A pragma to turn checks off ( HH_FIXME and HH_IGNORE_ERROR ) is always a leading trivia .
fn scan_leading_trivia(
        &mut self,
        scanner: impl Fn(&mut Self) -> Option<Trivium<TF>>,
    ) -> Trivia<TF> {
        let mut acc = self.token_factory.trivia_factory_mut().make();
        while let Some(t) = scanner(self) {
            acc.push(t)
        }
        acc
    }
fn scan_leading_trivia ( & mut self , scanner : impl Fn ( & mut Self ) -> Option < Trivium < TF > > , ) -> Trivia < TF > { let mut acc = self . token_factory . trivia_factory_mut ( ) . make ( ) ; while let Some ( t ) = scanner ( self ) { acc . push ( t ) } acc }
We divide trivia into "leading" and "trailing" trivia of an associated
token.
We divide trivia into " leading " and " trailing " trivia of an associated token .
&mut self
scanner
impl Fn(&mut Self) -> Option<Trivium<TF>>