fn scan_string_literal(&mut self) -> Result<String, String> {
        self.bump();    // discard `"`

        let mut s = String::new();
        loop {
            match self.scan_escaped_char() {
                ScannedChar::Normal('\"') => break,
                ScannedChar::Normal(c) | ScannedChar::Escape(c) => s.push(c),
                ScannedChar::InvalidEscape(c) => {
                    s.push(c);
                    let e = self.simple_error(s,
                        format!("invalid escape character `\\{}`", c)
                    ).map_report(|r| r.with_note("valid escape characters are \
                        \\b \\t \\n \\f \\r \\\" \\' \\\\ or octal escapes"
                    ));
                    return Err(e);
                },
                ScannedChar::Eof => return Err(self.simple_error(s,
                                        "unexpected EOF in string literal")),
            }
        }

        Ok(s)
    }
/// Scans a Java string literal.
///
/// ## Preconditions
/// `curr` needs to be `"`
Scans a Java string literal.
Scans a Java string literal .
fn scan_string_literal(&mut self) -> Result<String, String> {
        self.bump();    // discard `"`
        let mut s = String::new();
        loop {
            match self.scan_escaped_char() {
                ScannedChar::Normal('\"') => break,
                ScannedChar::Normal(c) | ScannedChar::Escape(c) => s.push(c),
                ScannedChar::InvalidEscape(c) => {
                    s.push(c);
                    let e = self.simple_error(s,
                        format!("invalid escape character `\\{}`", c)
                    ).map_report(|r| r.with_note("valid escape characters are \
                        \\b \\t \\n \\f \\r \\\" \\' \\\\ or octal escapes"
                    ));
                    return Err(e);
                },
                ScannedChar::Eof => return Err(self.simple_error(s,
                                        "unexpected EOF in string literal")),
            }
        }
        Ok(s)
    }
fn scan_string_literal ( & mut self ) -> Result < String , String > { self . bump ( ) ; // discard `"` let mut s = String :: new ( ) ; loop { match self . scan_escaped_char ( ) { ScannedChar :: Normal ( '\"' ) => break , ScannedChar :: Normal ( c ) | ScannedChar :: Escape ( c ) => s . push ( c ) , ScannedChar :: InvalidEscape ( c ) => { s . push ( c ) ; let e = self . simple_error ( s , format ! ( " \\ " c ) ) . map_report ( | r | r . with_note ( " \
 \\ \\ \\ \\ \\ \\ \" \\ \\ \\ " ) ) ; return Err ( e ) ; } , ScannedChar :: Eof => return Err ( self . simple_error ( s , " " ) ) , } } Ok ( s ) }
Scans a Java string literal.
Scans a Java string literal .
&mut self
&mut self
preconditions
`curr` needs to be `"`
` curr ` needs to be ` " `