]> git.donarmstrong.com Git - lilypond.git/commitdiff
* scm/framework-ps.scm (write-preamble): use (NAME . CONTENTS) and
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Wed, 13 Apr 2005 13:18:09 +0000 (13:18 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Wed, 13 Apr 2005 13:18:09 +0000 (13:18 +0000)
(NAME . FILE-NAME) tuples for font descriptions.
(write-preamble): display BeginFont DSC comments.

* python/fontextract.py (write_extracted_fonts): new file. Extract
font resources from a PS file.

* scripts/lilypond-book.py (option_definitions): --psfonts option.
(Compile_error.process_include): do_file returns chunks.

* make/ly-vars.make (DVIPS_FLAGS): don't load .map file.

* make/lysdoc-targets.make: .texi is .PRECIOUS

* scripts/lilypond-book.py (write_if_updated): new function.

13 files changed:
ChangeLog
Documentation/topdocs/GNUmakefile
input/regression/markup-scheme.ly
lily/scm-option.cc
make/ly-rules.make
make/ly-vars.make
make/lysdoc-targets.make
python/fontextract.py [new file with mode: 0644]
scm/framework-ps.scm
scm/markup.scm
scm/output-lib.scm
scripts/GNUmakefile
scripts/lilypond-book.py

index 089e0eed51759f604f09a7a9d9268399ce373ea4..bea50596314124504f8a698c9e7b0a6768d2f4c0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,9 +1,29 @@
+2005-04-13  Han-Wen Nienhuys  <hanwen@xs4all.nl>
+
+       * scm/framework-ps.scm (write-preamble): use (NAME . CONTENTS) and
+       (NAME . FILE-NAME) tuples for font descriptions. 
+       (write-preamble): display BeginFont DSC comments.
+
+       * python/fontextract.py (write_extracted_fonts): new file. Extract
+       font resources from a PS file.
+
+       * scripts/lilypond-book.py (option_definitions): --psfonts option.
+       (Compile_error.process_include): do_file returns chunks.
+
+       * make/ly-vars.make (DVIPS_FLAGS): don't load .map file.
+
+       * make/lysdoc-targets.make: .texi is .PRECIOUS
+
+       * scripts/lilypond-book.py (write_if_updated): new function.
+
 2005-04-13  Jan Nieuwenhuizen  <janneke@gnu.org>
 
        * scm/framework-eps.scm (dump-stencils-as-EPSes): Massage messages.
 
 2005-04-13  Han-Wen Nienhuys  <hanwen@xs4all.nl>
 
+       * scm/framework-eps.scm (dump-stencils-as-EPSes): no massages.
+
        * input/regression/markup-syntax.ly: remove \score.
 
        * scm/define-markup-commands.scm (draw-circle): add fill argument
index d607526ace5ce09912b2e1bd4e1ea12e0d668bef..43c2b26ab1c96f288a7a97c9a9e84edb41161cc4 100644 (file)
@@ -7,3 +7,4 @@ HTML_FILES=$(addprefix $(outdir)/, $(TEXI_FILES:.texi=.html) $(TELY_FILES:.tely=
 
 include $(depth)/make/stepmake.make 
 
+$(outdir)/NEWS.nexi: NEWS.tely
index c1f85aa4cf63209767a7ebd0ddf3144ee0a79650..10f9124b87a694ee2947b113dad9bb1f75f8f7ed 100644 (file)
@@ -7,6 +7,13 @@
 "
 
     }
+
+%{
+
+For maintenance reasons, we don't excercise the entire markup command set.
+
+%}
+
 \version "2.5.2"
 \score {
      {
@@ -25,7 +32,6 @@
             \combine "X" "+"   
             \combine "o" "/"
             \box \column { \line { "string 1" } \line { "string 2" } }
-            "$\\emptyset$"
             \italic Norsk
             \super "2"
             \dynamic sfzp
@@ -46,8 +52,6 @@
               #:combine "X" "+"   
               #:combine "o" "/"
               #:box #:column ("string 1" "string 2")
-              "$\\emptyset$"
-             #:draw-circle 1 0.3
              " "
               #:italic "Norsk"
               #:super "2"
index a4ded95e86a1340780f2e53e95ade0912a29c240..e7042cc44ddcdb9f579be21003e32a7f04375f9b 100644 (file)
@@ -99,7 +99,7 @@ LY_DEFINE (ly_set_option, "ly:set-option", 1, 1, 0, (SCM var, SCM val),
           "@end table\n"
           "\n"
           "This function is useful to call from the command line: @code{lilypond -e\n"
-          "\"(ly : set - option 'midi-debug #t)\"}.\n")
+          "\"(ly:set-option 'midi-debug #t)\"}.\n")
 {
   if (val == SCM_UNDEFINED)
     val = SCM_BOOL_T;
index 391fcd84edf2fec6d0754bf2bea5c36180f20707..c943392e6c906b9beecf164bf9f6e403d6795bce 100644 (file)
@@ -1,14 +1,14 @@
 .SUFFIXES: .doc .dvi .tely .texi .ly
 
 
-$(outdir)/%.latex: %.doc
+$(outdir)/%.latex $(outdir)/%.fonts.ps:  %.doc
        $(PYTHON) $(LILYPOND_BOOK) $(LILYPOND_BOOK_INCLUDES) --process='$(LILYPOND) $(LILYPOND_BOOK_INCLUDES)' --output=$(outdir) --verbose $(LILYPOND_BOOK_FLAGS) $<
 
 # don't do ``cd $(outdir)'', and assume that $(outdir)/.. is the src dir.
 # it is not, for --srcdir builds
 $(outdir)/%.texi: %.tely
        rm -f $$(grep -LF '% eof' $(outdir)/lily-*systems.tex 2>/dev/null)
-       $(PYTHON) $(LILYPOND_BOOK) $(LILYPOND_BOOK_INCLUDES) --process='$(LILYPOND) $(LILYPOND_BOOK_INCLUDES)' --output=$(outdir) --format=$(LILYPOND_BOOK_FORMAT) --verbose $(LILYPOND_BOOK_FLAGS) $<
+       $(PYTHON) $(LILYPOND_BOOK) --psfonts=$(basename $<).fonts.ps  $(LILYPOND_BOOK_INCLUDES) --process='$(LILYPOND) $(LILYPOND_BOOK_INCLUDES)' --output=$(outdir) --format=$(LILYPOND_BOOK_FORMAT) --verbose $(LILYPOND_BOOK_FLAGS) $<
 
 $(outdir)/%.texi: $(outdir)/%.tely
        rm -f $$(grep -LF '% eof' $(outdir)/lily-*systems.tex 2>/dev/null)
@@ -36,6 +36,7 @@ $(outdir)/%-book.ps: $(outdir)/%.ps
 $(outdir)/%.pdf: $(outdir)/%.dvi
        dvips $(DVIPS_FLAGS)  -o $@.pdfps -t $(DVIPS_PAPERSIZE)  $<
 # without -dSAFER
+# gs 8.15 complains of safety of loading a ttf directly 
        gs -dCompatibilityLevel=1.2 -sPAPERSIZE=a4 -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=$@ -dCompatibilityLevel=1.2 -sPAPERSIZE=a4 -c .setpdfwrite -f $@.pdfps
 
 $(outdir)/%.html.omf: %.tely
index 60194e57983b35548c256200c4b7b061a511ea83..4cf95cd9139c6d64f1879b13c853ddff35ebab3b 100644 (file)
@@ -17,5 +17,4 @@ TEXINFO_SOURCES += $(TELY_FILES) $(ITELY_FILES) $(ITEXI_FILES)
 EXTRA_DIST_FILES +=$(TELY_FILES) $(LY_FILES) $(ITEXI_FILES) $(ITELY_FILES) $(ILY_FILES)
 
 
-# not mf/out , not mf/$(outdir) 
-DVIPS_FLAGS= -u+$(builddir)/mf/out/lilypond.map  -Ppdf
+DVIPS_FLAGS= -h $(notdir $(basename $<)).fonts.ps
index a3a313758baaa51a7699c22adabf3b2fef3d6b20..147ee6366f629e68eb6f7e440e4254d4f38c0afa 100644 (file)
@@ -1,3 +1,5 @@
 
 
 local-WWW: $(outdir)/$(NAME).html $(outdir)/$(NAME).ps.gz $(outdir)/$(NAME).pdf
+
+.PRECIOUS: $(outdir)/$(NAME).texi
diff --git a/python/fontextract.py b/python/fontextract.py
new file mode 100644 (file)
index 0000000..12f4313
--- /dev/null
@@ -0,0 +1,112 @@
+import re
+import getopt
+import sys
+import os
+import string
+
+dsr_font_regex = re.compile ('%%DocumentSuppliedResources: font (.*)')
+begin_font_regex = re.compile ('%%BeginFont: (.*)')
+end_font_regex = re.compile ('%%EndFont')
+verbose = 0
+
+try:
+       import gettext
+       gettext.bindtextdomain ('lilypond', localedir)
+       gettext.textdomain ('lilypond')
+       _ = gettext.gettext
+except:
+       def _ (s):
+               return s
+       
+def scan_files (files):
+       file_of_font_dict = {}
+       for f in files:
+               if verbose:
+                       sys.stderr.write (_('Scanning %s') % f + '\n')
+               
+               header = open (f, 'r').read ()
+               idx = 0
+
+               extract_from_this = []
+               while idx < len (header):
+                       match = dsr_font_regex.search (header[idx:])
+                       if not match:
+                               break
+                       name = match.group (1)
+                       idx += match.end (1)
+                       if file_of_font_dict.has_key (name):
+                               continue
+
+                       file_of_font_dict[name] = f
+
+       return file_of_font_dict
+
+def get_file_fonts_dict (file_of_font_dict):
+       dict = {}
+       for (n, f) in file_of_font_dict.items ():
+               if not dict.has_key (f):
+                       dict[f] = []
+
+               dict[f].append (n)
+               
+       return dict
+
+def extract_fonts_from_file (extract_from_this, font_dict, filename):
+       if extract_from_this:
+               curr_font = []
+               curr_font_name = []
+               in_font = 0
+               for l in open (filename).readlines ():
+                       if not in_font and begin_font_regex.match (l):
+                               in_font = 1
+                               curr_font_name = begin_font_regex.match (l).group (1)
+                               curr_font = []
+                       elif in_font and end_font_regex.match (l):
+                               in_font = 0
+
+                               if curr_font_name in extract_from_this:
+                                       font_dict[curr_font_name] = string.join (curr_font, '')
+                                       if verbose:
+                                               sys.stderr.write (_('Extracted %s')
+                                                                 % curr_font_name + '\n')
+
+                               extract_from_this.remove (curr_font_name)
+                       elif in_font:
+                               curr_font.append (l)
+                       if not extract_from_this:
+                               break
+
+               if extract_from_this:
+                       sys.stderr.write ("Failed to extract %s from %s\n"
+                                         % (string.join (extract_from_this, ', '), f))
+
+def write_extracted_fonts (output_file_name, font_dict):
+       output = open (output_file_name, 'w')
+       output.write ('''%!PS-Adobe-3.0
+%%Creator: lilypond-extract-fonts
+''')
+
+       for x in font_dict.keys ():
+               output.write ('%%%%DocumentSuppliedResources: font %s\n' % x)
+
+       output.write ('''%%EndComments\n''')
+
+       for (k,v) in font_dict.items ():
+               output.write ('\n%%%%BeginFont: %s\n' % k)
+               output.write (v)
+               output.write ('\n%%%%EndFont')
+
+
+def extract_fonts (output_file_name, input_files):
+       d = scan_files (input_files)
+       ff = get_file_fonts_dict (d)
+       
+       font_dict = {}
+       for (file, fonts) in ff.items ():
+               extract_fonts_from_file (fonts, font_dict, file)
+
+       write_extracted_fonts (output_file_name, font_dict)
+
+
+if __name__ == '__main__':
+       extract_fonts ('fonts.ps', sys.argv[1:])
index 167ca939901cc9df68e67080d3e7ce63f864bd11..6275b12ec6abf6830c905920d5ebd49c14813d75 100644 (file)
    (equal? (substring fontname 0 2) "cm")
    (equal? (substring fontname 0 2) "ec")))
 
-(define (ps-embed-pfa body font-name version)
-  (string-append
-   (format
-    "%%BeginResource: font ~a
-~a
-%%EndResource\n"
-    font-name body)))
-
 
 (define (define-fonts paper)
   (define font-list (ly:paper-fonts paper))
                            name 'pre "PFA" 1 'post))
 
 (define (write-preamble paper load-fonts? port)
+  (define (load-font font-pair)
+    (let* ((name (car font-pair))
+          (file-name (cdr font-pair))
+                
+          (bare-file-name (ly:find-file file-name))
+          (cffname (string-append file-name ".cff.ps"))
+          (cff-file-name (ly:find-file cffname)))
+
+      (cons 
+       (munge-lily-font-name name)
+       (cond
+       ((and bare-file-name (string-match "\\.pfa" bare-file-name))
+        (cached-file-contents bare-file-name))
+       ((and bare-file-name (string-match "\\.pfb" bare-file-name))
+        (ly:pfb->pfa bare-file-name))
+       
+       ((string-match "([eE]mmentaler|[Aa]ybabtu)" file-name)
+        (cached-file-contents
+         (format "~a.pfa" (munge-lily-font-name file-name))))
+
+       ((and bare-file-name
+             (string-match "\\.(otf|cff)" bare-file-name))
+
+                                       ; replace with the CFF.ps, which lives in a
+                                       ; separate subdir.
+        (for-each (lambda (tup)
+                    (set! bare-file-name
+                          (string-regexp-substitute
+                           (car tup) (cdr tup) bare-file-name)))
+                  '(("/fonts/otf/" . "/ps/")
+                    ("/fonts/cff/" . "/ps/")
+                    ("\\.(otf|cff)" . ".cff.ps")))
+
+        (cached-file-contents bare-file-name))
+       ((and bare-file-name (string-match "\\.ttf" bare-file-name))
+        (ly:ttf->pfa bare-file-name))
+       (bare-file-name (cached-file-contents bare-file-name))
+       (cff-file-name  (cached-file-contents cff-file-name))
+       (else
+        (ly:warning (_ "can't find CFF/PFA/PFB font ~S=~S" name file-name))
+        (cons font-name ""))))))
+  
   (define (load-fonts paper)
     (let* ((fonts (ly:paper-fonts paper))
+
           (all-font-names
            (map
             (lambda (font)
               (cond
-               ((string? (ly:font-file-name font)) (list (ly:font-file-name font)))
+               ((string? (ly:font-file-name font))
+                (list (cons (ly:font-name font)
+                            (ly:font-file-name font))))
                ((ly:pango-font? font)
-                (map cdr  (ly:pango-font-physical-fonts font)))
-               (else (ly:font-sub-fonts font))))
+                (ly:pango-font-physical-fonts font))
+               (else
+                (ly:font-sub-fonts font))))
                   
             fonts))
-          
           (font-names
            (uniq-list
-            (sort (apply append all-font-names) string<?)))
-          (pfas (map
-                 (lambda (x)
-                   (let* ((bare-file-name (ly:find-file x))
-                          (cffname (string-append x ".cff.ps"))
-                          (cff-file-name (ly:find-file cffname)))
-
-                     
-                     (cond
-                      ((and bare-file-name (string-match "\\.pfa" bare-file-name))
-                       (cached-file-contents bare-file-name))
-                      ((and bare-file-name (string-match "\\.pfb" bare-file-name))
-                       (ly:pfb->pfa bare-file-name))
-                       
-                      ((string-match "([eE]mmentaler|[Aa]ybabtu)" x)
-                       (cached-file-contents
-                        (format "~a.pfa" (munge-lily-font-name x))))
-
-                      ((and bare-file-name
-                           (string-match "\\.(otf|cff)" bare-file-name))
-
-                       ; replace with the CFF.ps, which lives in a
-                       ; separate subdir.
-                       (for-each (lambda (tup)
-                                   (set! bare-file-name
-                                         (string-regexp-substitute
-                                          (car tup) (cdr tup) bare-file-name)))
-                                 '(("/fonts/otf/" . "/ps/")
-                                   ("/fonts/cff/" . "/ps/")
-                                   ("\\.(otf|cff)" . ".cff.ps")))
-
-                       (cached-file-contents bare-file-name))
-                      ((and bare-file-name (string-match "\\.ttf" bare-file-name))
-                       (ly:ttf->pfa bare-file-name))
-                      (bare-file-name (cached-file-contents bare-file-name))
-                      (cff-file-name  (cached-file-contents cff-file-name))
-                      (else
-                       (ly:warning (_ "can't find CFF/PFA/PFB font ~S" x))
-                       ""))))
-                 (filter string? font-names))))
-          pfas))
+            (sort (apply append all-font-names)
+                  (lambda (x y) (string<? (car x) (car y))))))
+          
+          (pfas (map load-font font-names)))
+      pfas))
 
   (if load-fonts?
-      (for-each (lambda (f) (display f port)) (load-fonts paper)))
+      (for-each
+       (lambda (f)
+        (format port "\n%%BeginFont: ~a\n" (car f))
+        (display (cdr f) port)
+        (display "\n%%EndFont\n" port))
+       (load-fonts paper)))
+      
   (display (setup paper) port)
 
   ; adobe note 5002: should initialize variables before loading routines.
index 29d919dde5550488473ef26db6280dba8905c124..9e48d7395a470dd84a93afacb5eba7997631618f 100644 (file)
@@ -85,8 +85,8 @@ against SIGNATURE, reporting MAKE-NAME as the user-invoked function.
                         #f)))
     (if (or (not (= arglen siglen)) (< siglen 0) (< arglen 0))
         (ly:error (string-append make-name ": "
-                   (_ "Wrong number of arguments.  Expect: ~A, found ~A: ~S")
-                   (list siglen arglen args))))
+                   (_ "Wrong number of arguments.  Expect: ~A, found ~A: ~S"))
+                 siglen arglen args))
     (if error-msg
         (ly:error
         (string-append
index 85e1adc114574d4f3e932fe3cf2ac6c0678456b1..d5d9d10264b5748adcf5f3bd65dcd313ce749751 100644 (file)
         (defs (ly:output-def-lookup layout 'text-font-defaults))
         (props (ly:grob-alist-chain grob defs))
         (circle (Text_interface::interpret_markup
-                 layout props (make-draw-circle-markup 0.8 0.1)))
+                 layout props (make-draw-circle-markup 0.8 0.1 #f)))
         (text-stencil (Text_interface::interpret_markup layout props text)))
+    
     (ly:stencil-add (centered-stencil text-stencil) circle)))
 
 
index b0d99517a1ecb12f12108fc4d674be0b64a2ecd7..ffb5eb4f65a2e06ec5d4f9c0d85d898adbf4f917 100644 (file)
@@ -1,6 +1,6 @@
 depth = ..
 
-SEXECUTABLES=convert-ly lilypond-book abc2ly etf2ly mup2ly midi2ly ps2png lilypond-pdfpc-helper
+SEXECUTABLES=convert-ly lilypond-book abc2ly etf2ly mup2ly midi2ly ps2png lilypond-pdfpc-helper lilypond-extract-fonts
 
 STEPMAKE_TEMPLATES=script help2man po
 LOCALSTEPMAKE_TEMPLATES = lilypond
index a36b08a0055c3f87bcae3fe390e1bdef9e1f18c6..637b96ef66e80323efbc642605d7b5cd5f1c3325 100644 (file)
@@ -55,6 +55,7 @@ sys.path.insert (0, os.path.join (datadir, 'python'))
 #if __name__ == '__main__':
 
 import lilylib as ly
+import fontextract
 global _;_=ly._
 global re;re = ly.re
 
@@ -92,6 +93,8 @@ option_definitions = [
          _ ("write output to DIR")),
        (_ ("COMMAND"), 'P', 'process',
          _ ("process ly_files using COMMAND FILE...")),
+       (_('FILE'), '', 'psfonts',
+        _('extract all PS snippet fonts into FILE')),
        ('', 'V', 'verbose',
          _ ("be verbose")),
        ('', 'v', 'version',
@@ -107,6 +110,7 @@ lilypond_binary = os.path.join ('@bindir@', 'lilypond')
 if '@bindir@' == ('@' + 'bindir@') or not os.path.exists (lilypond_binary):
        lilypond_binary = 'lilypond'
 
+psfonts_file = ''
 use_hash_p = 1
 format = 0
 output_name = 0
@@ -156,6 +160,7 @@ no_options = {
        NOINDENT: INDENT,
 }
 
+
 # Recognize special sequences in the input.
 #
 #   (?P<name>regex) -- Assign result of REGEX to NAME.
@@ -1324,6 +1329,20 @@ def guess_format (input_filename):
                ly.exit (1)
        return format
 
+def write_if_updated (file_name, lines):
+       try:
+               f = open (file_name)
+               oldstr = f.read ()
+               new_str = string.join (lines, '')
+               if old == new_str:
+                       ly.progress (_ ("Output file is up to date."))
+                       return
+       except:
+               pass
+
+       ly.progress (_ ("Writing output file."))
+       open (file_name, 'w').writelines (lines)
+
 def do_file (input_filename):
        # Ugh.
        if not input_filename or input_filename == '-':
@@ -1351,15 +1370,12 @@ def do_file (input_filename):
                output_filename = '-'
                output_file = sys.stdout
        else:
-               if not output_name:
-                       output_filename = input_base + format2ext[format]
-               else:
+               if output_name:
                        if not os.path.isdir (output_name):
                                os.mkdir (output_name, 0777)
-                       output_filename = (output_name
-                                          + '/' + input_base
-                                          + format2ext[format])
+                       os.chdir (output_name)
 
+               output_filename = input_base + format2ext[format]
                if os.path.exists (input_filename) \
                   and os.path.exists (output_filename) \
                   and os.path.samefile (output_filename, input_fullname):
@@ -1367,9 +1383,6 @@ def do_file (input_filename):
                          _ ("Output would overwrite input file; use --output."))
                        ly.exit (2)
 
-               output_file = open (output_filename, 'w')
-               if output_name:
-                       os.chdir (output_name)
        try:
                ly.progress (_ ("Reading %s...") % input_fullname)
                source = in_handle.read ()
@@ -1413,37 +1426,41 @@ def do_file (input_filename):
                                                break
 
                if filter_cmd:
-                       output_file.writelines ([c.filter_text () \
-                                                for c in chunks])
-
+                       write_if_updated (output_filename,
+                                         [c.filter_text () for c in chunks])
                elif process_cmd:
                        do_process_cmd (chunks, input_fullname)
                        ly.progress (_ ("Compiling %s...") % output_filename)
-                       output_file.writelines ([s.replacement_text () \
-                                                for s in chunks])
+                       write_if_updated (output_filename,
+                                         [s.replacement_text ()
+                                          for s in chunks])
                        ly.progress ('\n')
 
+               
+
                def process_include (snippet):
                        os.chdir (original_dir)
                        name = snippet.substring ('filename')
                        ly.progress (_ ("Processing include: %s") % name)
                        ly.progress ('\n')
-                       do_file (name)
+                       return do_file (name)
 
-               map (process_include,
-                    filter (lambda x: is_derived_class (x.__class__,
-                                                        Include_snippet),
-                            chunks))
+               include_chunks = map (process_include,
+                                     filter (lambda x: is_derived_class (x.__class__,
+                                                                         Include_snippet),
+                                             chunks))
+
+
+               return chunks + reduce (lambda x,y: x + y, include_chunks, [])
+               
        except Compile_error:
                os.chdir (original_dir)
                ly.progress (_ ("Removing `%s'") % output_filename)
                ly.progress ('\n')
-
-               os.unlink (output_filename)
                raise Compile_error
 
 def do_options ():
-       global format, output_name
+       global format, output_name, psfonts_file
        global filter_cmd, process_cmd, verbose_p
 
        (sh, long) = ly.getopt_args (option_definitions)
@@ -1489,6 +1506,8 @@ def do_options ():
                        sys.exit (0)
                elif o == '--verbose' or o == '-V':
                        verbose_p = 1
+               elif o == '--psfonts':
+                       psfonts_file = a
                elif o == '--warranty' or o == '-w':
                        if 1 or status:
                                ly.warranty ()
@@ -1521,7 +1540,15 @@ def main ():
        ly.setup_environment ()
 
        try:
-               do_file (file)
+               chunks = do_file (file)
+               if psfonts_file:
+                       snippet_chunks = filter (lambda x: is_derived_class (x.__class__,
+                                                                             Lilypond_snippet),
+                                                chunks)
+                       fontextract.extract_fonts (psfonts_file,
+                                                  [x.basename() + '.eps'
+                                                   for x in snippet_chunks])
+                       
        except Compile_error:
                ly.exit (1)