X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=python%2Fconvertrules.py;h=e2acf4e26617f5a3cfdda0cdf07c518c43424b96;hb=a7c14a5a83ddf2926895aa40cfdf50e7dcebf53c;hp=aee0530e9c71e98297b468e33212b4126c88de42;hpb=010656e27a58cc47feb2bd267e157f69f58cb74d;p=lilypond.git diff --git a/python/convertrules.py b/python/convertrules.py index aee0530e9c..e2acf4e266 100644 --- a/python/convertrules.py +++ b/python/convertrules.py @@ -3581,6 +3581,35 @@ def conv(str): vspace_replace, str) return str +@rule((2, 17, 20), _(r"Flag.transparent and Flag.color inherit from Stem")) +def conv(str): + str = re.sub (r"(((?:\\once\s*)?)\\override\s+((?:\w+\.)?)Stem\.(transparent|color)\s*=\s*(#\S+))\s+\2\\override\s+\3Flag\.\4\s*=\s*\5", + r"\1", str) + str = re.sub (r"(((?:\\once\s*)?)\\revert\s+((?:\w+\.)?)Stem\.(transparent|color))\s+\2\\revert\s+\3Flag\.\4", + r"\1", str) + str = re.sub (r"(\\tweak\s+((?:\w+\.)?)Stem\.(transparent|color)\s+(#\S+))\s+\\tweak\s+\2Flag\.\3\s+\4", + r"\1", str) + return str + +@rule((2, 17, 25), r'''\tempo 4. = 50~60 -> \tempo 4. = 50-60 +-| -> -!''') +def conv(str): +# This goes for \tempo commands ending with a range, like +# = 50 ~ 60 +# and uses - instead. We don't explicitly look for \tempo since the +# complete syntax has a large number of variants, and this is quite +# unlikely to occur in other contexts + str = re.sub (r"(=\s*[0-9]+\s*)~(\s*[0-9]+\s)", r"\1-\2", str) +# Match strings, and articulation shorthands that end in -^_ +# so that we leave alone -| in quoted strings and c4--| + def subnonstring(m): + if m.group (1): + return m.group (1)+"!" + return m.group (0) + str = re.sub (r"([-^_])\||" + matchstring + r"|[-^_][-^_]", subnonstring, str) + str = re.sub (r"\bdashBar\b", "dashBang", 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,