]> git.donarmstrong.com Git - lilypond.git/commitdiff
Issue 4614/3: convert-ly rule c:5.x, c:5^x, c:sus -> c:3.5.x, c:3.5^x, c:5
authorDavid Kastrup <dak@gnu.org>
Sun, 20 Sep 2015 14:40:47 +0000 (16:40 +0200)
committerDavid Kastrup <dak@gnu.org>
Sat, 26 Sep 2015 10:29:10 +0000 (12:29 +0200)
python/convertrules.py

index 03670e02cc304b221be5a5730a412b948ca7a4a2..d46daa6577ff2b3eacbf029fa2ee17119ddc9ed2 100644 (file)
@@ -3834,6 +3834,17 @@ def conv (str):
     str = re.sub (r"(\\applyOutput\s+)#'([a-zA-Z])", r"\1\2", str)
     return str
 
+@rule ((2, 19, 28), r"c:5.x, c:5^x, c:sus -> c:3.5.x, c:3.5^x, c:5")
+def conv (str):
+    str = re.sub (r":5([.^][1-9])", r":3.5\1", str)
+    # row back for self-defeating forms
+    str = re.sub (r":3\.5((?:\.[0-9]+)*\^(?:[0-9]+\.)*)3\.", r":5\1", str)
+    str = re.sub (r":3\.5((?:\.[0-9]+)*\^?:[0-9]+(?:\.[0-9]+)*)\.3(?![.0-9])", r":5\1", str)
+    str = re.sub (r":3\.5((?:\.[0-9]+)*)\^3(?=\s|\})", r":5\1", str)
+    str = re.sub (r":sus(?=\s|\})", ":5", str)
+    str = re.sub (r":1\.5(?=\s|[.^}])", r":5", str)
+    return str
+
 # Guidelines to write rules (please keep this at the end of this file)
 #
 # - keep at most one rule per version; if several conversions should be done,