fn read_string<Chars: Iterator<Item=char>>(buffer: &mut TokenReadBuffer<Chars>, location: FileLocation) -> (Token, String, FileLocation) {
    // Strings continue until the next '"' or the next unquoted newline character
    let mut quoted = false;
    loop {
        let next_chr    = buffer.read_next();
        let was_quoted  = quoted;
        quoted          = false;

        match (next_chr, was_quoted) {
            (None, _)           => break,
            (Some('"'), false)  => break,
            (Some('\\'), false) => { quoted = true; },
            (Some('\n'), false) |
            (Some('\r'), false) => {
                buffer.push_back();
                break;
            }
            (Some(_), _)        => { }
        }
    }

    (Token::String, buffer.read_characters(), buffer.update_location(location))
}
///
/// After reading a ", reads the rest of the string value
///
After reading a ", reads the rest of the string value
After reading a " reads the rest of the string value
fn read_string<Chars: Iterator<Item=char>>(buffer: &mut TokenReadBuffer<Chars>, location: FileLocation) -> (Token, String, FileLocation) {
    // Strings continue until the next '"' or the next unquoted newline character
    let mut quoted = false;
    loop {
        let next_chr    = buffer.read_next();
        let was_quoted  = quoted;
        quoted          = false;
        match (next_chr, was_quoted) {
            (None, _)           => break,
            (Some('"'), false)  => break,
            (Some('\\'), false) => { quoted = true; },
            (Some('\n'), false) |
            (Some('\r'), false) => {
                buffer.push_back();
                break;
            }
            (Some(_), _)        => { }
        }
    }
    (Token::String, buffer.read_characters(), buffer.update_location(location))
}
fn read_string < Chars : Iterator < Item = char > > ( buffer : & mut TokenReadBuffer < Chars > , location : FileLocation ) -> ( Token , String , FileLocation ) { // Strings continue until the next '"' or the next unquoted newline character let mut quoted = false ; loop { let next_chr = buffer . read_next ( ) ; let was_quoted = quoted ; quoted = false ; match ( next_chr , was_quoted ) { ( None , _ ) => break , ( Some ( '"' ) , false ) => break , ( Some ( '\\' ) , false ) => { quoted = true ; } , ( Some ( '\n' ) , false ) | ( Some ( '\r' ) , false ) => { buffer . push_back ( ) ; break ; } ( Some ( _ ) , _ ) => { } } } ( Token :: String , buffer . read_characters ( ) , buffer . update_location ( location ) ) }
After reading a ", reads the rest of the string value
After reading a " reads the rest of the string value
buffer
&mut TokenReadBuffer<Chars>
location
FileLocation
buffer
&mut TokenReadBuffer<Chars>
location
FileLocation