str = re.sub (r"#'whiteout-box(?![a-z_-])\b", r"#'whiteout", str)
return str
+@rule ((2, 19, 40), r"\time #'(2 3) ... -> \time 2,3 ...")
+def conv (str):
+ def repl (m):
+ return m.group(1) + re.sub (r"\s+", ",", m.group (2))
+
+ str = re.sub (r"(beatStructure\s*=\s*)#'\(([0-9]+(?:\s+[0-9]+)+)\)",
+ repl, str)
+
+ str = re.sub (r"(\\time\s*)#'\(([0-9]+(?:\s+[0-9]+)+)\)", repl, str)
+ def repl (m):
+ subst = re.sub (r"\s+", ",", m.group (1))
+ return subst + (4 + len (m.group (1)) - len (subst)) * " " + m.group (2)
+
+ str = re.sub (r"#'\(([0-9]+(?:\s+[0-9]+)+)\)(\s+%\s*beatStructure)",
+ repl, 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,