[PATCH] D17385: clang-format: [JS] single quote double quoted strings.

Daniel Jasper via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 24 03:01:40 PST 2016


djasper added inline comments.

================
Comment at: lib/Format/Format.cpp:1579
@@ +1578,3 @@
+  // The width of the extra \ escapes is taken into account in getNextToken.
+  void requoteJSStringLiterals(tooling::Replacements &Replaces,
+                               FormatToken *Current) {
----------------
What's the reason not to do this in FormatTokenLexer, ideally at the same time when increasing the length?

================
Comment at: lib/Format/Format.cpp:1585
@@ +1584,3 @@
+      StringRef Input = Current->TokenText;
+      std::stringstream Res;
+      Res << '\'';
----------------
LLVM comes with its own string stream implementation. Use that: raw_string_ostream.


http://reviews.llvm.org/D17385





More information about the cfe-commits mailing list