[PATCH] clang-format: [js] Support template strings.

Martin Probst martinprobst at google.com
Fri Feb 20 04:44:01 PST 2015


================
Comment at: lib/Format/Format.cpp:798
@@ +797,3 @@
+          IsMultiline || I[0]->NewlinesBefore > 0 || I[0]->IsMultiline;
+      if (I[0]->isNot(tok::unknown) || I[0]->TokenText != "`")
+        continue;
----------------
djasper wrote:
> mprobst wrote:
> > djasper wrote:
> > > Can you add a test with two template strings? I think that might do the wrong thing as you need to abort when you find a TT_TemplateString.
> > It's not strictly needed - if there was a preceding template string, it cannot just equals "`", it must have at least opener and closer "``". But it's a reasonable optimization and IMHO adds clarity.
> I agree. Still seems useful to have a test ;-).
Sorry for being unclear, I actually did add one.

http://reviews.llvm.org/D7763

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the cfe-commits mailing list