]> git.donarmstrong.com Git - lilypond.git/blobdiff - scripts/lilypond-book.py
Merge branch 'master' into lilypond/translation
[lilypond.git] / scripts / lilypond-book.py
index ac3969c9cc27335d69feae420d47b8d249bdb112..64a90310b715c317b19f57e42b1339e0e7f2c5d8 100644 (file)
@@ -390,9 +390,9 @@ snippet_res = {
          r'''(?mx)
           (?P<match>
           <lilypond
-           (\s*(?P<options>.*?)\s*:)?\s*
+           (\s+(?P<options>.*?))?\s*:\s*
            (?P<code>.*?)
-          />)''',
+          \s*/>)''',
 
         'lilypond_block':
          r'''(?msx)
@@ -401,7 +401,7 @@ snippet_res = {
            \s*(?P<options>.*?)\s*
           >
           (?P<code>.*?)
-          </lilypond>)''',
+          </lilypond\s*>)''',
 
         'lilypond_file':
          r'''(?mx)
@@ -410,7 +410,7 @@ snippet_res = {
            \s*(?P<options>.*?)\s*
           >
           \s*(?P<filename>.*?)\s*
-          </lilypondfile>)''',
+          </lilypondfile\s*>)''',
 
         'multiline_comment':
          r'''(?smx)
@@ -1205,10 +1205,11 @@ left-margin-default right-margin-default)"
         option_list = []
         for option in self.get_option_list ():
             for name in PROCESSING_INDEPENDENT_OPTIONS:
-                if not option.startswith (name):
-                    option_list.append (option)
+                if option.startswith (name):
+                    break
+            else:
+                option_list.append (option)
         option_string = ','.join (option_list)
-
         compose_dict = {}
         compose_types = [NOTES, PREAMBLE, LAYOUT, PAPER]
         for a in compose_types:
@@ -1285,8 +1286,10 @@ left-margin-default right-margin-default)"
             hash = md5 (self.relevant_contents (self.ly ()))
             for option in self.get_option_list ():
                 for name in PROCESSING_INDEPENDENT_OPTIONS:
-                    if not option.startswith (name):
-                        hash.update (option)
+                    if option.startswith (name):
+                        break
+                else:
+                    hash.update (option)
 
             ## let's not create too long names.
             self.checksum = hash.hexdigest ()[:10]