X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fparser.yy;h=59cbf58502275c853ff0f07e344f8e46d1dd635f;hb=37ca1f80bf5401accd17056938f4f7b2c147ddb2;hp=9df1034d165a2fbabb5b4c052cf917d8698dcbd3;hpb=9cfb34deec4b1cdfa4d147846f38b72c562be3d9;p=lilypond.git diff --git a/lily/parser.yy b/lily/parser.yy index 9df1034d16..59cbf58502 100644 --- a/lily/parser.yy +++ b/lily/parser.yy @@ -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 MARKUP_HEAD_SCM0_MARKUP1 %token MARKUP_HEAD_SCM0_SCM1 %token MARKUP_HEAD_SCM0_SCM1_MARKUP2 +%token MARKUP_HEAD_SCM0_MARKUP1_MARKUP2 %token MARKUP_HEAD_SCM0_SCM1_SCM2 +%token MARKUP_LIST_HEAD_EMPTY +%token MARKUP_LIST_HEAD_LIST0 +%token MARKUP_LIST_HEAD_SCM0 +%token MARKUP_LIST_HEAD_SCM0_LIST1 +%token MARKUP_LIST_HEAD_SCM0_SCM1_LIST2 %token MARKUP_IDENTIFIER %token MUSIC_FUNCTION %token MUSIC_IDENTIFIER @@ -372,6 +379,7 @@ If we give names, Bison complains. %type figure_spec %type fraction %type full_markup +%type full_markup_list %type function_scm_argument %type function_arglist %type function_arglist_music_last @@ -386,6 +394,7 @@ If we give names, Bison complains. %type markup_braced_list %type markup_braced_list_body %type markup_composed_list +%type markup_command_list %type markup_head_1_item %type markup_head_1_list %type 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); } @@ -651,12 +664,23 @@ book_body: $2->unprotect (); } | book_body score_block { - SCM s = $2->self_scm (); - $$->add_score (s); - $2->unprotect(); + Score *score = $2; + SCM proc = PARSER->lexer_->lookup_identifier ("book-score-handler"); + scm_call_2 (proc, $$->self_scm (), score->self_scm ()); + score->unprotect (); + } + | book_body composite_music { + Music *music = unsmob_music ($2); + SCM proc = PARSER->lexer_->lookup_identifier ("book-music-handler"); + scm_call_3 (proc, PARSER->self_scm (), $$->self_scm (), music->self_scm ()); } | book_body full_markup { - $$->add_score ($2); + 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); } | book_body lilypond_header { $$->header_ = $2; @@ -696,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) @@ -796,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 ); + } ; /* @@ -1443,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 { @@ -1883,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); + } } ; @@ -1897,6 +1937,9 @@ figured_bass_modification: | '/' { $$ = ly_symbol2scm ("slash"); } + | E_BACKSLASH { + $$ = ly_symbol2scm ("backslash"); + } ; br_bass_figure: @@ -2178,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; @@ -2209,6 +2261,9 @@ markup_list: | markup_braced_list { $$ = $1; } + | markup_command_list { + $$ = scm_list_1 ($1); + } ; markup_composed_list: @@ -2234,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); @@ -2286,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); }