| 871 | /// [QuoteStyle] must not be [QuoteStyle::None] |
| 872 | #[inline] |
| 873 | pub fn with_quotes(&self, quote_style: QuoteStyle) -> Token { |
| 874 | debug_assert!(quote_style != QuoteStyle::None); |
| 875 | if self.kind_bits() != Kind::String as u8 || quote_style == self.quote_style() { |
| 876 | return *self; |
| 877 | } |
| 878 | Token::new_string(quote_style, self.has_close_quote(), self.contains_escape_chars(), self.len()) |
| 879 | } |
| 880 | |
| 881 | /// If the [Token] is a [Kind::String] this checks if the string ended in a close quote. |
| 882 | /// It is possible to have a valid String token that does not end in a close quote, by eliding the quote at the end of |