[PATCH] D13765: clang-format: [JS] Handle string literals spanning character classes.

Martin Probst via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 16 16:46:33 PDT 2015


mprobst added inline comments.

================
Comment at: lib/Format/Format.cpp:757
@@ -756,3 +756,1 @@
-      if (tryMergeEscapeSequence())
-        return;
       if (tryMergeTemplateString())
----------------
You cannot actually escape in a template string - backslashes in them are literal backslashes. I.e. `foo\`bar` does not work.

However we do have a test for that that is presumably wrong (but still passes with this change):
```
  EXPECT_EQ("var x = ` \\` a`;\n"
            "var y;",
            format("var x = ` \\` a`;\n"
                   "var y;"));
```

We can fix that in a later change, I think it's unrelated to this change.


http://reviews.llvm.org/D13765





More information about the cfe-commits mailing list