+# Decorator to make rule syntax simpler
+def rule (version, message):
+ """
+ version: a LilyPond version tuple like (2, 11, 50)
+ message: the message that describes the conversion.
+
+ This decorator adds its function together with the version and the
+ message to the global conversions list. (It doesn't need to return
+ the function as it isn't used directly anyway.)
+
+ A conversion rule using this decorator looks like this:
+
+ @rule ((1, 2, 3), "convert foo to bar")
+ def conv(str):
+ str = str.replace('foo', 'bar')
+ return str
+
+ """
+ def dec(f):
+ conversions.append ((version, f, message))
+ return dec
+
+
+@rule ((0, 1, 9), _ ('\\header { key = concat + with + operator }'))