]> git.donarmstrong.com Git - lilypond.git/commitdiff
* lily/my-lily-parser.cc (parse_string): init parser variable when
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Sun, 20 Jun 2004 20:43:52 +0000 (20:43 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Sun, 20 Jun 2004 20:43:52 +0000 (20:43 +0000)
lexer_ is set, ie. in parse_string and parse_file.

* scm/lily.scm (collect-scores-for-book): new function.

* lily/my-lily-parser.cc (LY_DEFINE): define parser in parser
scope, not in lily module.

ChangeLog
lily/my-lily-parser.cc
scm/lily.scm
scm/safe-lily.scm

index 60ac76a11f0ab8140949598911d99b3c43442f63..e220bc8905446095925c3546837f48c9e283063f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2004-06-20  Han-Wen Nienhuys   <hanwen@xs4all.nl>
 
+       * lily/my-lily-parser.cc (parse_string): init parser variable when
+       lexer_ is set, ie. in parse_string and parse_file.
+
        * lily/book.cc (LY_DEFINE): new function. ly:make-book. Supercedes
        ly:score-bookify.
 
index 1abe0fe85a9f3c62a8a8619bd670d424c35a09af..100b2c47713f2f3fb2ffbdd617333e78fe4d9a4c 100644 (file)
@@ -85,6 +85,9 @@ void
 My_lily_parser::parse_file (String init, String name, String out_name)
 {
   lexer_ = new My_lily_lexer (sources_);
+  // TODO: use $parser 
+  lexer_->set_identifier (ly_symbol2scm ("parser"),
+                         self_scm ());
   output_basename_ = out_name;
   
   lexer_->main_input_name_ = name;
@@ -117,6 +120,10 @@ My_lily_parser::parse_string (String ly_code)
   lexer_ = (parent == 0 ? new My_lily_lexer (sources_)
            : new My_lily_lexer (*parent));
 
+  // TODO: use $parser 
+  lexer_->set_identifier (ly_symbol2scm ("parser"),
+                         self_scm ());
+  
   lexer_->main_input_name_ = "<string>";
   lexer_->main_input_b_ = true;
 
@@ -280,9 +287,6 @@ LY_DEFINE (ly_parse_file, "ly:parse-file",
 
       My_lily_parser *parser = new My_lily_parser (&sources);
 
-      // TODO: use $parser 
-      parser->lexer_->set_identifier (ly_symbol2scm ("parser"),
-                                     parser->self_scm ());
       parser->parse_file (init, file_name, out_file);
 
       bool error = parser->error_level_;
index ecd29e3876fd13186d43fc8ba993cdb2d9ffb356..57a5f337c7409e7abaa6144a731f561e3bf0633f 100644 (file)
 
 ;; parser stuff.
 (define-public (print-music-as-book parser music)
-  (let* (
-        (head  (ly:parser-lookup parser '$globalheader))
-        (book (ly:score-bookify score head)))
+  (let* ((head  (ly:parser-lookup parser '$globalheader))
+        (book (ly:make-book (ly:parser-lookup parser $defaultbookpaper)
+                            head score)))
     (ly:parser-print-book parser book)))
 
 (define-public (print-score-as-book parser score)
   (let*
       ((head  (ly:parser-lookup parser '$globalheader))
-       (book (ly:score-bookify score head)))
-    
+       (book (ly:make-book (ly:parser-lookup parser $defaultbookpaper)
+                          head score)))
     (ly:parser-print-book parser book)))
 
 (define-public (print-score parser score)
   (let* ((head  (ly:parser-lookup parser '$globalheader))
-       (book (ly:score-bookify score head)))
+        (book (ly:make-book (ly:parser-lookup parser $defaultbookpaper)
+                            head score)))
     (ly:parser-print-score parser book)))
                
 (define-public (collect-scores-for-book  parser score)
index 47752e3bedef7798cd95f45229b071067bf3555e..5a9cbe0348fc04f36abca558aabe443041cd5389 100644 (file)
      ly:round-filled-box
      ly:run-translator
      ly:set-option
-     ly:score-bookify
      ly:set-point-and-click
      ly:spanner-broken-into
      ly:spanner-get-bound