From: David Kastrup Date: Sun, 20 Sep 2015 14:40:47 +0000 (+0200) Subject: Issue 4614/3: convert-ly rule c:5.x, c:5^x, c:sus -> c:3.5.x, c:3.5^x, c:5 X-Git-Tag: release/2.19.28-1~5^2~1^2~5 X-Git-Url: https://git.donarmstrong.com/?p=lilypond.git;a=commitdiff_plain;h=2bfeb6186a202b5e228c491ea7e44040ae75589f Issue 4614/3: convert-ly rule c:5.x, c:5^x, c:sus -> c:3.5.x, c:3.5^x, c:5 --- diff --git a/python/convertrules.py b/python/convertrules.py index 03670e02cc..d46daa6577 100644 --- a/python/convertrules.py +++ b/python/convertrules.py @@ -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,