]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/parser.yy
Docs: reorg of AU almost complete.
[lilypond.git] / lily / parser.yy
index f821cd7efeb83db30bce19d4b67ac062d1056e21..813452ef599e814421704a6e3b3a52344dd15f97 100644 (file)
@@ -3,7 +3,7 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c) 1997--2007 Han-Wen Nienhuys <hanwen@xs4all.nl>
+  (c) 1997--2009 Han-Wen Nienhuys <hanwen@xs4all.nl>
                  Jan Nieuwenhuizen <janneke@gnu.org>
 */
 
@@ -508,10 +508,7 @@ toplevel_expression:
                Output_def * od = $1;
 
                if ($1->c_variable ("is-paper") == SCM_BOOL_T)
-               {
                        id = ly_symbol2scm ("$defaultpaper");
-                       init_papers (PARSER, od);
-               }
                else if ($1->c_variable ("is-midi") == SCM_BOOL_T)
                        id = ly_symbol2scm ("$defaultmidi");
                else if ($1->c_variable ("is-layout") == SCM_BOOL_T)
@@ -657,7 +654,8 @@ context_def_spec_body:
 book_block:
        BOOK '{' book_body '}'  {
                $$ = $3;
-               unstack_paper (PARSER);
+               pop_paper (PARSER);
+               PARSER->lexer_->set_identifier (ly_symbol2scm ("$current-book"), SCM_BOOL_F);
        }
        ;
 
@@ -667,16 +665,19 @@ book_block:
 book_body:
        {
                $$ = new Book;
+               init_papers (PARSER);
                $$->origin ()->set_spot (@$);
                $$->paper_ = dynamic_cast<Output_def*> (unsmob_output_def (PARSER->lexer_->lookup_identifier ("$defaultpaper"))->clone ());
                $$->paper_->unprotect ();
-               stack_paper (PARSER, $$->paper_);
+               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;
@@ -724,6 +725,7 @@ book_body:
 bookpart_block:
        BOOKPART '{' bookpart_body '}' {
                $$ = $3;
+               PARSER->lexer_->set_identifier (ly_symbol2scm ("$current-bookpart"), SCM_BOOL_F);
        }
        ;
 
@@ -731,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;