]> git.donarmstrong.com Git - lilypond.git/blobdiff - scripts/convert-ly.py
release: 1.3.152
[lilypond.git] / scripts / convert-ly.py
index 03733c2d494001c41f7998802196e8f19e6367cd..c4e0619901c52c2c3cc22ce0d4e8c797940189da 100644 (file)
@@ -706,7 +706,7 @@ if 1:
                def regularize_assignment (match):
                        return '\n' + regularize_id (match.group (1)) + ' = '
                str = re.sub ('\$([^\t\n ]+)', regularize_dollar_reference, str)
-               str = re.sub ('\n([^ \t\n]+) = ', regularize_assignment, str)
+               str = re.sub ('\n([^ \t\n]+)[ \t]*= *', regularize_assignment, str)
                return str
        
        conversions.append (((1,3,117), conv, 'identifier names: $!foo_bar_123 -> xfooBarABC'))
@@ -800,13 +800,32 @@ if 1:
                str = re.sub ('\\\\key[ \t]*;', '\\key \\default;', str)
                str = re.sub ('\\\\mark[ \t]*;', '\\mark \\default;', str)
 
-               # only remove ; that are directly after words.
-               # otherwise  we interfere with Scheme comments, which is badbadbad.
-               str = re.sub ("([^ \t]);", "\\1", str)
+               # Make sure groups of more than one ; have space before
+               # them, so that non of them gets removed by next rule
+               str = re.sub ("([^ \n\t;]);(;+)", "\\1 ;\\2", str)
+               
+               # Only remove ; that are not after spaces, # or ;
+               # Otherwise  we interfere with Scheme comments,
+               # which is badbadbad.
+               str = re.sub ("([^ \t;#]);", "\\1", str)
 
                return str
        conversions.append (((1,3,146), conv, 'semicolons removed'))
 
+if 1:
+       def conv (str):
+               str = re.sub ('default-neutral-direction', 'neutral-direction',str)
+               return str
+       conversions.append (((1,3,147), conv, 'default-neutral-direction -> neutral-direction'))
+
+if 1:
+       def conv (str):
+               str = re.sub ('\(align', '(axis', str)
+               str = re.sub ('\(rows', '(columns', str)
+               return str
+       conversions.append (((1,3,148), conv, '"(align" -> "(axis", "(rows" -> "(columns"'))
+
+
 ################################
 #      END OF CONVERSIONS      
 ################################
@@ -943,11 +962,13 @@ identify ()
 for f in files:
        if f == '-':
                f = ''
+       if not os.path.isfile (f):
+               continue
        try:
                do_one_file (f)
        except UnknownVersion:
                sys.stderr.write ('\n')
-               sys.stderr.write ("%s: can't determine version for %s" % (program_name, f))
+               sys.stderr.write ("%s: can't determine version for `%s'" % (program_name, f))
                sys.stderr.write ('\n')
                if assume_old:
                        fv = from_version
@@ -955,6 +976,6 @@ for f in files:
                        do_one_file (f)
                        from_version = fv
                else:
-                       sys.stderr.write ("%s: skipping: %s " % (program_name,  f))
+                       sys.stderr.write ("%s: skipping: `%s' " % (program_name,  f))
                pass
 sys.stderr.write ('\n')