fn tokenize_single_quoted_string(
        &self,
        chars: &mut Peekable<Chars<'_>>,
    ) -> Result<String, TokenizerError> {
        let mut s = String::new();
        chars.next(); // consume the opening quote
        while let Some(&ch) = chars.peek() {
            match ch {
                '\'' => {
                    chars.next(); // consume
                    let escaped_quote = chars.peek().map(|c| *c == '\'').unwrap_or(false);
                    if escaped_quote {
                        s.push('\'');
                        chars.next();
                    } else {
                        return Ok(s);
                    }
                }
                _ => {
                    chars.next(); // consume
                    s.push(ch);
                }
            }
        }
        self.tokenizer_error("Unterminated string literal")
    }
/// Read a single quoted string, starting with the opening quote.
Read a single quoted string, starting with the opening quote.
Read a single quoted string starting with the opening quote .
fn tokenize_single_quoted_string(
        &self,
        chars: &mut Peekable<Chars<'_>>,
    ) -> Result<String, TokenizerError> {
        let mut s = String::new();
        chars.next(); // consume the opening quote
        while let Some(&ch) = chars.peek() {
            match ch {
                '\'' => {
                    chars.next(); // consume
                    let escaped_quote = chars.peek().map(|c| *c == '\'').unwrap_or(false);
                    if escaped_quote {
                        s.push('\'');
                        chars.next();
                    } else {
                        return Ok(s);
                    }
                }
                _ => {
                    chars.next(); // consume
                    s.push(ch);
                }
            }
        }
        self.tokenizer_error("Unterminated string literal")
    }
fn tokenize_single_quoted_string ( & self , chars : & mut Peekable < Chars < ' _ > > , ) -> Result < String , TokenizerError > { let mut s = String :: new ( ) ; chars . next ( ) ; // consume the opening quote while let Some ( & ch ) = chars . peek ( ) { match ch { '\'' => { chars . next ( ) ; // consume let escaped_quote = chars . peek ( ) . map ( | c | * c == '\'' ) . unwrap_or ( false ) ; if escaped_quote { s . push ( '\'' ) ; chars . next ( ) ; } else { return Ok ( s ) ; } } _ => { chars . next ( ) ; // consume s . push ( ch ) ; } } } self . tokenizer_error ( " " ) }
Read a single quoted string, starting with the opening quote.
Read a single quoted string starting with the opening quote .
&self
chars
&mut Peekable<Chars<'_>>