X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fparser.yy;h=0bb4c152f273455dd1e02f201803e66d8eeaa685;hb=c1d5bb448321d688185e0c6b798575d4c325ae80;hp=abcf101386d6da55e5c7f6a511afeeadb77d3eeb;hpb=235de94b7408e9badc7b82c8e0dae8f05009adc3;p=lilypond.git diff --git a/lily/parser.yy b/lily/parser.yy index abcf101386..0bb4c152f2 100644 --- a/lily/parser.yy +++ b/lily/parser.yy @@ -1,7 +1,7 @@ /* This file is part of LilyPond, the GNU music typesetter. - Copyright (C) 1997--2010 Han-Wen Nienhuys + Copyright (C) 1997--2011 Han-Wen Nienhuys Jan Nieuwenhuizen LilyPond is free software: you can redistribute it and/or modify @@ -290,6 +290,7 @@ If we give names, Bison complains. %token MARKUP_FUNCTION %token MARKUP_LIST_FUNCTION %token MARKUP_IDENTIFIER +%token MARKUPLINES_IDENTIFIER %token MUSIC_FUNCTION %token MUSIC_IDENTIFIER %token NOTENAME_PITCH @@ -437,6 +438,7 @@ If we give names, Bison complains. %type step_number %type step_numbers %type string +%type tempo_range %type score_block %type score_body @@ -614,6 +616,9 @@ identifier_init: | full_markup { $$ = $1; } + | full_markup_list { + $$ = $1; + } | DIGIT { $$ = scm_from_int ($1); } @@ -906,20 +911,14 @@ output_def_body: ; tempo_event: - TEMPO steno_duration '=' bare_unsigned { - $$ = MAKE_SYNTAX ("tempo", @$, SCM_BOOL_F, $2, scm_from_int ($4)); - } - | TEMPO string steno_duration '=' bare_unsigned { - $$ = MAKE_SYNTAX ("tempo", @$, make_simple_markup($2), $3, scm_from_int ($5)); + TEMPO steno_duration '=' tempo_range { + $$ = MAKE_SYNTAX ("tempo", @$, SCM_EOL, $2, $4); } - | TEMPO full_markup steno_duration '=' bare_unsigned { - $$ = MAKE_SYNTAX ("tempo", @$, $2, $3, scm_from_int ($5)); + | TEMPO scalar steno_duration '=' tempo_range { + $$ = MAKE_SYNTAX ("tempo", @$, $2, $3, $5); } - | TEMPO string { - $$ = MAKE_SYNTAX ("tempoText", @$, make_simple_markup($2) ); - } - | TEMPO full_markup { - $$ = MAKE_SYNTAX ("tempoText", @$, $2 ); + | TEMPO scalar { + $$ = MAKE_SYNTAX ("tempo", @$, $2); } ; @@ -1261,18 +1260,33 @@ new_lyrics: $$ = scm_cons ($3, SCM_EOL); } + | ADDLYRICS { + PARSER->lexer_->push_lyric_state (); } + MUSIC_IDENTIFIER { + PARSER->lexer_->pop_state (); + $$ = scm_cons ($3, SCM_EOL); + } | new_lyrics ADDLYRICS { PARSER->lexer_->push_lyric_state (); } grouped_music_list { PARSER->lexer_->pop_state (); $$ = scm_cons ($4, $1); } + | new_lyrics ADDLYRICS { + PARSER->lexer_->push_lyric_state (); + } MUSIC_IDENTIFIER { + PARSER->lexer_->pop_state (); + $$ = scm_cons ($4, $1); + } ; re_rhythmed_music: grouped_music_list new_lyrics { $$ = MAKE_SYNTAX ("add-lyrics", @$, $1, scm_reverse_x ($2, SCM_EOL)); } + | MUSIC_IDENTIFIER new_lyrics { + $$ = MAKE_SYNTAX ("add-lyrics", @$, $1, scm_reverse_x ($2, SCM_EOL)); + } | LYRICSTO simple_string { PARSER->lexer_->push_lyric_state (); } music { @@ -1690,8 +1704,12 @@ post_event: direction_less_event { $$ = $1; } - | '-' music_function_event { + | script_dir music_function_event { $$ = run_music_function (PARSER, $2); + if ($1) + { + unsmob_music ($$)->set_property ("direction", scm_from_int ($1)); + } } | HYPHEN { if (!PARSER->lexer_->is_lyric_state ()) @@ -2274,6 +2292,15 @@ step_number: } ; +tempo_range: + bare_unsigned { + $$ = scm_from_int ($1); + } + | bare_unsigned '~' bare_unsigned { + $$ = scm_cons (scm_from_int ($1), scm_from_int ($3)); + } + ; + /* UTILITIES @@ -2345,7 +2372,6 @@ unsigned_number: } ; - exclamations: { $$ = 0; } | exclamations '!' { $$ ++; } @@ -2373,7 +2399,10 @@ lyric_markup: ; full_markup_list: - MARKUPLINES + MARKUPLINES_IDENTIFIER { + $$ = $1; + } + | MARKUPLINES { PARSER->lexer_->push_markup_state (); } markup_list { $$ = $3; @@ -2406,7 +2435,10 @@ markup_top: ; markup_list: - markup_composed_list { + MARKUPLINES_IDENTIFIER { + $$ = $1; + } + | markup_composed_list { $$ = $1; } | markup_braced_list { @@ -2599,6 +2631,9 @@ Lily_lexer::try_special_identifiers (SCM *destination, SCM sid) if (is_lyric_state ()) return LYRIC_MARKUP_IDENTIFIER; return MARKUP_IDENTIFIER; + } else if (Text_interface::is_markup_list (sid)) { + *destination = sid; + return MARKUPLINES_IDENTIFIER; } return -1;