X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=python%2Fconvertrules.py;h=5d44fd7a150c7fb33e241c247330ae754392ff4f;hb=1b36fe672946c010741b3679c028a3f7723f4cd8;hp=acabe0237e452869b4648caf98180af7c8ace815;hpb=c924aab690820bb69bec043608b4a7b46023bafb;p=lilypond.git diff --git a/python/convertrules.py b/python/convertrules.py index acabe0237e..5d44fd7a15 100644 --- a/python/convertrules.py +++ b/python/convertrules.py @@ -3346,7 +3346,7 @@ def conv (str): sub_tempo, str) return str -@rule((2, 15, 39), r"\footnote -> <>\footnote, -\footnote -> \footnote") +@rule((2, 15, 39), r"\footnote ... -> \footnote ... \default") def conv (str): def not_first (s): def match_fun (m): @@ -3355,15 +3355,72 @@ def conv (str): return m.expand (s) return match_fun str = re.sub ("(" + matchmarkup + ")|" - + r"(?\3"), str) - str = re.sub ("(" + matchmarkup + ")|" - + r"(? \set Staff.stringTuning") +def conv (str): + str = re.sub (r"(\\set\s+)stringTuning", r"\1Staff.stringTuning", str) + return str + +wordsyntax = r"[a-zA-Z\200-\377](?:[-_]?[a-zA-Z\200-\377])*" + +@rule ((2, 15, 43), r'"custom-tuning" = -> custom-tuning =') +def conv (str): + str = re.sub ('\n"(' + wordsyntax + r')"(\s*=\s*\\stringTuning)', "\n\\1\\2", str) + return str + +@rule ((2, 16, 0), + _ ("bump version for release")) +def conv (str): + return str + +@rule ((2, 17, 0), r"blank-*-force -> blank-*-penalty") +def conv (str): + str = re.sub ('blank-page-force', 'blank-page-penalty', str) + str = re.sub ('blank-last-page-force', 'blank-last-page-penalty', str) + str = re.sub ('blank-after-score-page-force', 'blank-after-score-page-penalty', str) + return str + + +@rule ((2, 17, 4), r"\shape Grob #offsets -> \shape #offsets Grob") +def conv (str): + str = re.sub (r"\\shape(\s+(?:[a-zA-Z]+|" + matchstring + "))(" + + matcharg + ")", r"\\shape\2\1", str) + return str + +barstring=r"(\\bar|whichBar|defaultBarType|segnoType|doubleRepeatType|startRepeatType|endRepeatType|doubleRepeatSegnoType|startRepeatSegnoType|endRepeatSegnoType)(\s*[=]?\s*[#]?)" + +@rule ((2, 17, 5), r"New bar line interface") +def conv(str): + str = re.sub (barstring + r'"\|:"', '\\1\\2".|:"', str) + str = re.sub (barstring + r'":\|"', '\\1\\2":|."', str) + str = re.sub (barstring + r'"\|\|:"', '\\1\\2".|:-||"', str) + str = re.sub (barstring + r'":\|:"', '\\1\\2":..:"', str) + str = re.sub (barstring + r'"\.\|\."', '\\1\\2".."', str) + str = re.sub (barstring + r'"\|S"', '\\1\\2"S-|"', str) + str = re.sub (barstring + r'"S\|"', '\\1\\2"S-S"', str) + str = re.sub (barstring + r'":\|S"', '\\1\\2":|.S"', str) + str = re.sub (barstring + r'":\|S\."', '\\1\\2":|.S-S"', str) + str = re.sub (barstring + r'"S\|:"', '\\1\\2"S.|:-S"', str) + str = re.sub (barstring + r'"\.S\|:"', '\\1\\2"S.|:"', str) + str = re.sub (barstring + r'":\|S\|:"', '\\1\\2":|.S.|:"', str) + str = re.sub (barstring + r'":\|S\.\|:"', '\\1\\2":|.S.|:-S"', str) + str = re.sub (barstring + r'":"', '\\1\\2";"', str) + str = re.sub (barstring + r'"\|s"', '\\1\\2"|-s"', str) + str = re.sub (barstring + r'"dashed"', '\\1\\2"!"', str) + str = re.sub (barstring + r'"kievan"', '\\1\\2"k"', str) + str = re.sub (barstring + r'"empty"', '\\1\\2"-"', str) return str # Guidelines to write rules (please keep this at the end of this file)