]> git.donarmstrong.com Git - lilypond.git/commitdiff
scripts/auxiliar/fixcc.py: remove annoyances
authorKeith OHara <k-ohara5a5a@oco.net>
Mon, 1 Aug 2011 04:11:17 +0000 (21:11 -0700)
committerKeith OHara <k-ohara5a5a@oco.net>
Mon, 1 Aug 2011 04:25:05 +0000 (21:25 -0700)
Don't touch an operator that lies alone on a line
Let the C++ nit-picking rules see the open double quote of strings

scripts/auxiliar/fixcc.py

index ca7806fe58bfdd8f93402ee9d6ecc4193e915cec..4449a45b47fb07e1dac29afba3b916f14c5798c2 100755 (executable)
@@ -67,7 +67,7 @@ rules = {
     ('([\w\(\)\]]) +(&&|\|\||<=|>=|!=|\|=|==|\+=|-=|\*=|/=|\?|<|>|\+|-|=|/|:|&|\||\*) +([\w\(\)])', '\\1 \\2 \\3'),
 
     # trailing operator, but don't un-trail close angle-braces > nor pointer *, and not before a preprocessor line
-    (' (::|&&|\|\||<=|>=|!=|\|=|==|\+=|-=|\*=|/=|\?|<|\+|-|=|/|:|&XXX|\||\*XXX) *\n( *)([^\s#])', '\n\\2\\1 \\3'),
+    ('(?<!\s) (::|&&|\|\||<=|>=|!=|\|=|==|\+=|-=|\*=|/=|\?|<|\+|-|=|/|:|&XXX|\||\*XXX) *\n( *)([^\s#])', '\n\\2\\1 \\3'),
     # space after `operator'
     ('(\Woperator) *([^\w\s])', '\\1 \\2'),
     # trailing parenthesis open
@@ -133,9 +133,10 @@ snippet_res = {
 
     'string':
     r'''(?x)
+    "      # leave the leading " character visible to CXX rules
     (?P<match>
     (?P<code>
-    "([^"\n]|\\")*"))''',
+    ([^"\n]|\\")*"))''',
     
     'char':
     r'''(?x)