| 649 | } |
| 650 | |
| 651 | std::string FormatStringLiteral(absl::string_view str) { |
| 652 | absl::string_view quote = |
| 653 | (str.find('"') != str.npos && str.find('\'') == str.npos) ? "'" : "\""; |
| 654 | return absl::StrCat(quote, EscapeInternal(str, true, quote[0]), quote); |
| 655 | } |
| 656 | |
| 657 | std::string FormatStringLiteral(const absl::Cord& str) { |
| 658 | if (auto flat = str.TryFlat(); flat) { |