krasimir created this revision.
krasimir added a reviewer: klimek.
Herald added a subscriber: cfe-commits.

This adds some delimiters to detect cpp code in raw strings.


Repository:
  rC Clang

https://reviews.llvm.org/D46062

Files:
  lib/Format/Format.cpp


Index: lib/Format/Format.cpp
===================================================================
--- lib/Format/Format.cpp
+++ lib/Format/Format.cpp
@@ -718,20 +718,39 @@
   GoogleStyle.ObjCSpaceAfterProperty = false;
   GoogleStyle.ObjCSpaceBeforeProtocolList = true;
   GoogleStyle.PointerAlignment = FormatStyle::PAS_Left;
-  GoogleStyle.RawStringFormats = {{
-      FormatStyle::LK_TextProto,
-      /*Delimiters=*/
+  GoogleStyle.RawStringFormats = {
       {
-          "pb",
-          "PB",
-          "proto",
-          "PROTO",
+          FormatStyle::LK_Cpp,
+          /*Delimiters=*/
+          {
+              "cc",
+              "CC",
+              "cpp",
+              "Cpp",
+              "CPP",
+              "c++",
+              "C++",
+          },
+          /*EnclosingFunctionNames=*/
+          {},
+          /*CanonicalDelimiter=*/"",
+          /*BasedOnStyle=*/"google",
       },
-      /*EnclosingFunctionNames=*/
-      {},
-      /*CanonicalDelimiter=*/"",
-      /*BasedOnStyle=*/"google",
-  }};
+      {
+          FormatStyle::LK_TextProto,
+          /*Delimiters=*/
+          {
+              "pb",
+              "PB",
+              "proto",
+              "PROTO",
+          },
+          /*EnclosingFunctionNames=*/
+          {},
+          /*CanonicalDelimiter=*/"",
+          /*BasedOnStyle=*/"google",
+      },
+  };
   GoogleStyle.SpacesBeforeTrailingComments = 2;
   GoogleStyle.Standard = FormatStyle::LS_Auto;
 


Index: lib/Format/Format.cpp
===================================================================
--- lib/Format/Format.cpp
+++ lib/Format/Format.cpp
@@ -718,20 +718,39 @@
   GoogleStyle.ObjCSpaceAfterProperty = false;
   GoogleStyle.ObjCSpaceBeforeProtocolList = true;
   GoogleStyle.PointerAlignment = FormatStyle::PAS_Left;
-  GoogleStyle.RawStringFormats = {{
-      FormatStyle::LK_TextProto,
-      /*Delimiters=*/
+  GoogleStyle.RawStringFormats = {
       {
-          "pb",
-          "PB",
-          "proto",
-          "PROTO",
+          FormatStyle::LK_Cpp,
+          /*Delimiters=*/
+          {
+              "cc",
+              "CC",
+              "cpp",
+              "Cpp",
+              "CPP",
+              "c++",
+              "C++",
+          },
+          /*EnclosingFunctionNames=*/
+          {},
+          /*CanonicalDelimiter=*/"",
+          /*BasedOnStyle=*/"google",
       },
-      /*EnclosingFunctionNames=*/
-      {},
-      /*CanonicalDelimiter=*/"",
-      /*BasedOnStyle=*/"google",
-  }};
+      {
+          FormatStyle::LK_TextProto,
+          /*Delimiters=*/
+          {
+              "pb",
+              "PB",
+              "proto",
+              "PROTO",
+          },
+          /*EnclosingFunctionNames=*/
+          {},
+          /*CanonicalDelimiter=*/"",
+          /*BasedOnStyle=*/"google",
+      },
+  };
   GoogleStyle.SpacesBeforeTrailingComments = 2;
   GoogleStyle.Standard = FormatStyle::LS_Auto;
 
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
  • [PATCH] D46062: [clang-f... Krasimir Georgiev via Phabricator via cfe-commits

Reply via email to