/// Determines behavior in case of a newline. This might be
/// necessary when multiple newlines come one after another.
Determines behavior in case of a newline. This might be
necessary when multiple newlines come one after another.
Determines behavior in case of a newline . This might be necessary when multiple newlines come one after another .
fn newline(&mut self) {
        let mut count = 1;
        while let Some(ch) = self.peek() {
            if ch != '\n' && ch != '\r' {
                break;
            }
            if ch == '\n' {
                count += 1;
            }
            self.advance();
        }
        if count == 1 {
            self.add_subtoken(SubTokenKind::NewLine);
        } else {
            for _ in 0..count - 1 {
                self.line += 1;
                self.add_subtoken(SubTokenKind::BlankLine);
            }
        }
        self.line += 1;
    }
fn newline ( & mut self ) { let mut count = 1 ; while let Some ( ch ) = self . peek ( ) { if ch != '\n' && ch != '\r' { break ; } if ch == '\n' { count += 1 ; } self . advance ( ) ; } if count == 1 { self . add_subtoken ( SubTokenKind :: NewLine ) ; } else { for _ in 0 .. count - 1 { self . line += 1 ; self . add_subtoken ( SubTokenKind :: BlankLine ) ; } } self . line += 1 ; }
Determines behavior in case of a newline.
Determines behavior in case of a newline .
&mut self