]> git.donarmstrong.com Git - lilypond.git/commitdiff
Style: disable removal of "gratuitous" blocks.
authorGraham Percival <gperciva@gperciva-desktop.(none)>
Wed, 6 Oct 2010 16:33:35 +0000 (17:33 +0100)
committerGraham Percival <gperciva@gperciva-desktop.(none)>
Thu, 7 Oct 2010 12:54:27 +0000 (13:54 +0100)
This rule removed any {} which were around a single statment, but
this removal broke any .h file with short inline function
definitions (such as a "getFoo() { return foo; }").

The templates in flower/include/std-vector.hh were hit
particularly hard by this rule.

scripts/auxiliar/fixcc.py

index b77982e2c652ac0ee1ad23649c96945c21593df0..4f74ab94bb6771d2b61b642d5c86603601189785 100755 (executable)
@@ -46,9 +46,9 @@ indent_p = 0
 rules = {
     GLOBAL_CXX:
     [
-    # delete gratuitous block
-    ('''\n(    |\t)\s*{\n\s*(.*?)(?![{}]|\b(do|for|else|if|switch|while)\b);\n\s*}''',
-    '\n\\2;'),
+    # delete gratuitous block -- disabled because it breaks .h files
+#    ('''\n(    |\t)\s*{\n\s*(.*?)(?![{}]|\b(do|for|else|if|switch|while)\b);\n\s*}''',
+#    '\n\\2;'),
     ],
     CXX:
     [
@@ -56,9 +56,9 @@ rules = {
     ('([^\( \]])[ \t]*\(', '\\1 ('),
     # space after comma
     ("\([^'],\)[ \t]*", '\1 '),
-    # delete gratuitous block
-    ('''\n(    |\t)\s*{\n\s*(.*?)(?![{}]|\b(do|for|else|if|switch|while)\b);\n\s*}''',
-    '\n\\2;'),
+    # delete gratuitous block -- disabled because it breaks .h files
+#    ('''\n(    |\t)\s*{\n\s*(.*?)(?![{}]|\b(do|for|else|if|switch|while)\b);\n\s*}''',
+#    '\n\\2;'),
     # delete inline tabs
     ('(\w)\t+', '\\1 '),
     # delete inline double spaces