[PATCH] clang-format: [js] Support classes.

Daniel Jasper djasper at google.com
Wed Feb 18 08:29:17 PST 2015


================
Comment at: lib/Format/UnwrappedLineParser.cpp:829-831
@@ -828,1 +828,5 @@
+        if (FormatTok->Tok.is(tok::colon) &&
+            // Colon in class bodies is a typed member variable in JS.
+            (Style.Language != FormatStyle::LK_JavaScript ||
+             !Line->MustBeDeclaration)) {
           parseLabel();
----------------
As JavaScript also doesn't have function-like macros without trailing semicolon, could you move this to the outer if?

http://reviews.llvm.org/D7725

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






More information about the cfe-commits mailing list