]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/parser.yy
Merge branch 'master' into dev/texi2html
[lilypond.git] / lily / parser.yy
index 9d209b9462cdb881cc973911f10fa4715b891823..59cbf58502275c853ff0f07e344f8e46d1dd635f 100644 (file)
@@ -182,6 +182,7 @@ void set_music_properties (Music *p, SCM a);
 %token LYRICSTO "\\lyricsto"
 %token MARK "\\mark"
 %token MARKUP "\\markup"
+%token MARKUPLINES "\\markuplines"
 %token MIDI "\\midi"
 %token NAME "\\name"
 %token NOTEMODE "\\notemode"
@@ -279,7 +280,13 @@ If we give names, Bison complains.
 %token <scm> MARKUP_HEAD_SCM0_MARKUP1
 %token <scm> MARKUP_HEAD_SCM0_SCM1
 %token <scm> MARKUP_HEAD_SCM0_SCM1_MARKUP2
+%token <scm> MARKUP_HEAD_SCM0_MARKUP1_MARKUP2
 %token <scm> MARKUP_HEAD_SCM0_SCM1_SCM2
+%token <scm> MARKUP_LIST_HEAD_EMPTY
+%token <scm> MARKUP_LIST_HEAD_LIST0
+%token <scm> MARKUP_LIST_HEAD_SCM0
+%token <scm> MARKUP_LIST_HEAD_SCM0_LIST1
+%token <scm> MARKUP_LIST_HEAD_SCM0_SCM1_LIST2
 %token <scm> MARKUP_IDENTIFIER
 %token <scm> MUSIC_FUNCTION
 %token <scm> MUSIC_IDENTIFIER
@@ -372,6 +379,7 @@ If we give names, Bison complains.
 %type <scm> figure_spec
 %type <scm> fraction
 %type <scm> full_markup
+%type <scm> full_markup_list
 %type <scm> function_scm_argument
 %type <scm> function_arglist
 %type <scm> function_arglist_music_last
@@ -386,6 +394,7 @@ If we give names, Bison complains.
 %type <scm> markup_braced_list
 %type <scm> markup_braced_list_body 
 %type <scm> markup_composed_list
+%type <scm> markup_command_list
 %type <scm> markup_head_1_item
 %type <scm> markup_head_1_list
 %type <scm> markup_list
@@ -477,6 +486,10 @@ toplevel_expression:
                scm_call_2 (proc, PARSER->self_scm (), music->self_scm ());
        }
        | full_markup {
+               SCM proc = PARSER->lexer_->lookup_identifier ("toplevel-text-handler");
+               scm_call_2 (proc, PARSER->self_scm (), scm_list_1 ($1));
+       }
+       | full_markup_list {
                SCM proc = PARSER->lexer_->lookup_identifier ("toplevel-text-handler");
                scm_call_2 (proc, PARSER->self_scm (), $1);
        }
@@ -662,6 +675,10 @@ book_body:
                scm_call_3 (proc, PARSER->self_scm (), $$->self_scm (), music->self_scm ());
        }
        | book_body full_markup {
+               SCM proc = PARSER->lexer_->lookup_identifier ("book-text-handler");
+               scm_call_2 (proc, $$->self_scm (), scm_list_1 ($2));
+       }
+       | book_body full_markup_list {
                SCM proc = PARSER->lexer_->lookup_identifier ("book-text-handler");
                scm_call_2 (proc, $$->self_scm (), $2);
        }
@@ -703,7 +720,7 @@ score_body:
                $$->user_key_ = ly_scm2string ($2);
        }
        | score_body lilypond_header    {
-               $$->header_ = $2;
+               $$->set_header ($2);
        }
        | score_body output_def {
                if ($2->lookup_variable (ly_symbol2scm ("is-paper")) == SCM_BOOL_T)
@@ -803,8 +820,20 @@ output_def_body:
 
 tempo_event:
        TEMPO steno_duration '=' bare_unsigned  {
-               $$ = MAKE_SYNTAX ("tempo", @$, $2, scm_int2num ($4));
-       }                               
+               $$ = MAKE_SYNTAX ("tempo", @$, SCM_BOOL_F, $2, scm_int2num ($4));
+       }
+       | TEMPO string steno_duration '=' bare_unsigned {
+               $$ = MAKE_SYNTAX ("tempo", @$, make_simple_markup($2), $3, scm_int2num ($5));
+       }
+       | TEMPO full_markup steno_duration '=' bare_unsigned    {
+               $$ = MAKE_SYNTAX ("tempo", @$, $2, $3, scm_int2num ($5));
+       }
+       | TEMPO string {
+               $$ = MAKE_SYNTAX ("tempoText", @$, make_simple_markup($2) );
+       }
+       | TEMPO full_markup {
+               $$ = MAKE_SYNTAX ("tempoText", @$, $2 );
+       }
        ;
 
 /*
@@ -1450,7 +1479,7 @@ command_element:
        | PARTIAL duration_length       {
                Moment m = - unsmob_duration ($2)->get_length ();
                $$ = MAKE_SYNTAX ("property-operation", @$, SCM_BOOL_F, ly_symbol2scm ("Timing"), ly_symbol2scm ("PropertySet"), ly_symbol2scm ("measurePosition"), m.smobbed_copy ());
-               $$ = MAKE_SYNTAX ("context-specification", @$, ly_symbol2scm ("Timing"), SCM_BOOL_F, $$, SCM_EOL, SCM_BOOL_F);
+               $$ = MAKE_SYNTAX ("context-specification", @$, ly_symbol2scm ("Score"), SCM_BOOL_F, $$, SCM_EOL, SCM_BOOL_F);
        }
 
        | TIME_T fraction  {
@@ -1890,6 +1919,10 @@ bass_figure:
                        {
                        m->set_property ("no-continuation", SCM_BOOL_T);
                        }
+               else if ($2 == ly_symbol2scm ("backslash"))
+                       {
+                       m->set_property ("augmented-slash", SCM_BOOL_T);
+                       }
        }
        ;
 
@@ -1904,6 +1937,9 @@ figured_bass_modification:
        | '/'           {
                $$ = ly_symbol2scm ("slash");
        }
+       | E_BACKSLASH {
+               $$ = ly_symbol2scm ("backslash");
+       }
        ;
 
 br_bass_figure:
@@ -2185,6 +2221,15 @@ lyric_markup:
        }
        ;
 
+full_markup_list:
+       MARKUPLINES
+               { PARSER->lexer_->push_markup_state (); }
+       markup_list {
+               $$ = $3;
+               PARSER->lexer_->pop_state ();
+       }
+       ;
+
 full_markup:
        MARKUP_IDENTIFIER {
                $$ = $1;
@@ -2216,6 +2261,9 @@ markup_list:
        | markup_braced_list {
                $$ = $1;
        }
+       | markup_command_list {
+               $$ = scm_list_1 ($1);
+       }
        ;
 
 markup_composed_list:
@@ -2241,6 +2289,24 @@ markup_braced_list_body:
        }
        ;
 
+markup_command_list:
+       MARKUP_LIST_HEAD_EMPTY  {
+               $$ = scm_list_1 ($1);
+       }
+       | MARKUP_LIST_HEAD_LIST0 markup_list    {
+               $$ = scm_list_2 ($1, $2);
+       }
+       | MARKUP_LIST_HEAD_SCM0 embedded_scm    {
+               $$ = scm_list_2 ($1, $2);
+       }
+       | MARKUP_LIST_HEAD_SCM0_LIST1 embedded_scm markup_list  {
+               $$ = scm_list_3 ($1, $2, $3);
+       }
+       | MARKUP_LIST_HEAD_SCM0_SCM1_LIST2 embedded_scm embedded_scm markup_list        {
+               $$ = scm_list_4 ($1, $2, $3, $4);
+       }
+       ;
+
 markup_head_1_item:
        MARKUP_HEAD_MARKUP0     {
                $$ = scm_list_1 ($1);
@@ -2293,6 +2359,9 @@ simple_markup:
        | MARKUP_HEAD_SCM0_SCM1 embedded_scm embedded_scm {
                $$ = scm_list_3 ($1, $2, $3);
        }
+       | MARKUP_HEAD_SCM0_MARKUP1_MARKUP2 embedded_scm markup markup {
+               $$ = scm_list_4 ($1, $2, $3, $4);
+       }
        | MARKUP_HEAD_EMPTY {
                $$ = scm_list_1 ($1);
        }