fn read_comment<Chars: Iterator<Item=char>>(buffer: &mut TokenReadBuffer<Chars>, location: FileLocation) -> (Token, String, FileLocation) {
    // Read until the next newline
    loop {
        // Read the next character
        let next_chr = buffer.read_next();

        // Stop at EOF or on a newline
        match next_chr {
            None        => break,
            Some('\n')  => break,
            Some('\r')  => {
                if buffer.read_next() != Some('\n') {
                    buffer.push_back();
                }
                break;
            }
            _           =>  {}
        }
    }

    (Token::Comment, buffer.read_characters(), buffer.update_location(location))
}
///
/// After reading a ';', reads the remainder of the comment
///
After reading a ';', reads the remainder of the comment
After reading a ' ; ' reads the remainder of the comment
fn read_comment<Chars: Iterator<Item=char>>(buffer: &mut TokenReadBuffer<Chars>, location: FileLocation) -> (Token, String, FileLocation) {
    // Read until the next newline
    loop {
        // Read the next character
        let next_chr = buffer.read_next();
        // Stop at EOF or on a newline
        match next_chr {
            None        => break,
            Some('\n')  => break,
            Some('\r')  => {
                if buffer.read_next() != Some('\n') {
                    buffer.push_back();
                }
                break;
            }
            _           =>  {}
        }
    }
    (Token::Comment, buffer.read_characters(), buffer.update_location(location))
}
fn read_comment < Chars : Iterator < Item = char > > ( buffer : & mut TokenReadBuffer < Chars > , location : FileLocation ) -> ( Token , String , FileLocation ) { // Read until the next newline loop { // Read the next character let next_chr = buffer . read_next ( ) ; // Stop at EOF or on a newline match next_chr { None => break , Some ( '\n' ) => break , Some ( '\r' ) => { if buffer . read_next ( ) != Some ( '\n' ) { buffer . push_back ( ) ; } break ; } _ => { } } } ( Token :: Comment , buffer . read_characters ( ) , buffer . update_location ( location ) ) }
After reading a ';', reads the remainder of the comment
After reading a ' ; ' reads the remainder of the comment
buffer
&mut TokenReadBuffer<Chars>
location
FileLocation
buffer
&mut TokenReadBuffer<Chars>
location
FileLocation