]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/parser.yy
Merge branch 'lilypond/translation' of ssh://jomand@git.sv.gnu.org/srv/git/lilypond
[lilypond.git] / lily / parser.yy
index 83eaf89ec235912c7bccb69ef2b44dd9bc6b3943..813452ef599e814421704a6e3b3a52344dd15f97 100644 (file)
@@ -3,7 +3,7 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c) 1997--2008 Han-Wen Nienhuys <hanwen@xs4all.nl>
+  (c) 1997--2009 Han-Wen Nienhuys <hanwen@xs4all.nl>
                  Jan Nieuwenhuizen <janneke@gnu.org>
 */
 
@@ -655,6 +655,7 @@ book_block:
        BOOK '{' book_body '}'  {
                $$ = $3;
                pop_paper (PARSER);
+               PARSER->lexer_->set_identifier (ly_symbol2scm ("$current-book"), SCM_BOOL_F);
        }
        ;
 
@@ -670,11 +671,13 @@ book_body:
                $$->paper_->unprotect ();
                push_paper (PARSER, $$->paper_);
                $$->header_ = PARSER->lexer_->lookup_identifier ("$defaultheader"); 
+               PARSER->lexer_->set_identifier (ly_symbol2scm ("$current-book"), $$->self_scm ());
        }
        | BOOK_IDENTIFIER {
                $$ = unsmob_book ($1);
                $$->protect ();
                $$->origin ()->set_spot (@$);
+               PARSER->lexer_->set_identifier (ly_symbol2scm ("$current-book"), $1);
        }
        | book_body paper_block {
                $$->paper_ = $2;
@@ -722,6 +725,7 @@ book_body:
 bookpart_block:
        BOOKPART '{' bookpart_body '}' {
                $$ = $3;
+               PARSER->lexer_->set_identifier (ly_symbol2scm ("$current-bookpart"), SCM_BOOL_F);
        }
        ;
 
@@ -729,11 +733,13 @@ bookpart_body:
        {
                $$ = new Book;
                $$->origin ()->set_spot (@$);
+               PARSER->lexer_->set_identifier (ly_symbol2scm ("$current-bookpart"), $$->self_scm ());
        }
        | BOOK_IDENTIFIER {
                $$ = unsmob_book ($1);
                $$->protect ();
                $$->origin ()->set_spot (@$);
+               PARSER->lexer_->set_identifier (ly_symbol2scm ("$current-bookpart"), $1);
        }
        | bookpart_body paper_block {
                $$->paper_ = $2;