]> git.donarmstrong.com Git - lilypond.git/blobdiff - python/convertrules.py
Issue 4384: Remove convert-ly rule \shiftOff -> \undo\shiftOn
[lilypond.git] / python / convertrules.py
index 7809041353a3f9d909cb7e15da1345b0159bc8a8..8dc8e9160ab887078c30a01bba3b9916df74f682 100644 (file)
@@ -3723,10 +3723,24 @@ def conv(str):
     str = re.sub (r'\bthin-kern\b', 'segno-kern', str)
     return str
 
-@rule ((2, 19, 12), "var #'prop ... = -> var.prop =")
+# before_id is written in a manner where it will only substantially
+# (rather than as a lookbefore assertion) match material that could
+# not be part of a previous id.  In that manner, one replacement does
+# not inhibit an immediately adjacent replacement.
+
+before_id = r'(?:^|(?<!\\)(?:\\\\)+|(?<=[^-_\\a-zA-Z])|(?<=[^a-zA-Z][-_]))'
+
+# after_id is a pure lookbehind assertion so its match string is
+# always empty
+
+after_id = r'(?![a-zA-Z]|[-_][a-zA-Z])'
+
+@rule ((2, 19, 16), """implicitTimeSignatureVisibility -> initialTimeSignatureVisibility
+csharp -> c-sharp""")
 def conv(str):
-    str = re.sub (r'(\s)(' + wordsyntax + r"(?:\s+#\s*'\s*"
-                  + wordsyntax + r")+)(?=\s*=)", path_replace, str)
+    str = re.sub (r'\bimplicitTimeSignatureVisibility\b', 'initialTimeSignatureVisibility', str)
+    str = re.sub ('(' + before_id + r'[a-g])((?:sharp){1,2}|(?:flat){1,2})'
+                  + after_id, r'\1-\2', str)
     return str
 
 # Guidelines to write rules (please keep this at the end of this file)