From 118812e2df57d1035a3f1c75070ddac50fa5e88e Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Sun, 18 Apr 2004 15:14:23 +0000 Subject: [PATCH] * lily/lexer.ll, lily/parser.yy: * input/simple-song.ly: Idem. --- ChangeLog | 2 +- input/simple-song.ly | 2 +- lily/my-lily-lexer.cc | 1 + lily/parser.yy | 30 +++++++++++++++++++++++++++++- 4 files changed, 32 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5ddb1543b3..e005535612 100644 --- a/ChangeLog +++ b/ChangeLog @@ -16,7 +16,7 @@ * Grok \relative COMPOSITE_MUSIC, make relative on middleC. - * \addlyrics is a shortcut for \context Lyrics \lyricsto "" \lyrics + * \newlyrics is a shortcut for \context Lyrics \lyricsto "" \lyrics * input/simple.ly: New file. diff --git a/input/simple-song.ly b/input/simple-song.ly index fed51a97ed..0b1023628c 100644 --- a/input/simple-song.ly +++ b/input/simple-song.ly @@ -6,7 +6,7 @@ c2 c d4 f g2 } - \addlyrics { + \newlyrics { My first Li -- ly song, Not much can go wrong! } diff --git a/lily/my-lily-lexer.cc b/lily/my-lily-lexer.cc index d7c320c896..f23fdad76c 100644 --- a/lily/my-lily-lexer.cc +++ b/lily/my-lily-lexer.cc @@ -61,6 +61,7 @@ static Keyword_ent the_key_tab[] = { {"midi", MIDI}, {"name", NAME}, {"new", NEWCONTEXT}, + {"newlyrics", NEWLYRICS}, {"notes", NOTES}, {"octave", OCTAVE}, {"once", ONCE}, diff --git a/lily/parser.yy b/lily/parser.yy index b4a509c615..c8c6fa4cdf 100644 --- a/lily/parser.yy +++ b/lily/parser.yy @@ -302,6 +302,7 @@ or %token SCM_T %token SCORE %token SEQUENTIAL +%token NEWLYRICS %token SIMULTANEOUS %token SKIP %token SPANREQUEST @@ -375,6 +376,7 @@ or %type Composite_music Simple_music %type Repeated_music %type Alternative_music +%type Composite_music_list %type tremolo_type %type bare_int bare_unsigned %type script_dir @@ -845,6 +847,17 @@ Alternative_music: } ; +Composite_music_list: {}; +/* Too many s/r r/r problems + Composite_music { + $$ = scm_cons ($1, SCM_EOL); + } + | '{' Music_list '}' { + $$ = $2; + } + ; +*/ + Repeated_music: REPEAT string bare_unsigned Music Alternative_music { @@ -1181,8 +1194,23 @@ relative_music: ; re_rhythmed_music: - ADDLYRICS { THIS->lexer_->push_lyric_state (); } + ADDLYRICS Music Music { + Music *m = MY_MAKE_MUSIC ("LyricCombineMusic"); + m->set_property ("elements", scm_listify ($2->self_scm (), + $3->self_scm (), SCM_UNDEFINED)); + scm_gc_unprotect_object ($3->self_scm ()); + scm_gc_unprotect_object ($2->self_scm ()); + $$ = m; + } + | +/* Too many s/r r/r problems + Music +*/ + NEWLYRICS { THIS->lexer_->push_lyric_state (); } /* cont */ +/* Too many s/r r/r problems + Composite_music_list +*/ Music { THIS->lexer_->pop_state (); -- 2.39.5