From: Jan Nieuwenhuizen Date: Mon, 19 Apr 2004 16:12:54 +0000 (+0000) Subject: * lily/parser.yy (scalar): Bugfix: accept LYRICS_STRING. X-Git-Tag: release/2.3.1~67 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=c89a650c77bf9cda37889a8d65c9c9d3d652a8c8;p=lilypond.git * lily/parser.yy (scalar): Bugfix: accept LYRICS_STRING. FIXME: Replace some `Music's with Grouped_music_list; fixes make web. * lily/parser.yy (new_lyrics): Return SCM list of lyric musics. (Music_list): Allow embedded scm. * lily/parser.yy (book_block, score_block, toplevel_music): Use them. --- diff --git a/ChangeLog b/ChangeLog index a12a6654d7..5fe814e32b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2004-04-19 Jan Nieuwenhuizen + * lily/parser.yy (scalar): Bugfix: accept LYRICS_STRING. + FIXME: Replace some `Music's with Grouped_music_list; fixes make web. + * input/regression/newaddlyrics.ly: New file. * Documentation/topdocs/NEWS.texi: Update. diff --git a/Documentation/user/notation.itely b/Documentation/user/notation.itely index 7907f01a09..87b6f3a119 100644 --- a/Documentation/user/notation.itely +++ b/Documentation/user/notation.itely @@ -2734,8 +2734,7 @@ an abbreviated name, and both be used in input files hihat hh bassdrum bd @end example @lilypond[quote,raggedright] - \new DrumStaff \drums { hihat hh bassdrum bd - } +\new DrumStaff \drums { hihat hh bassdrum bd } @end lilypond The complete list of drum names is in the init file @@ -2776,10 +2775,10 @@ polyphonic notation, described in @ref{Polyphony}, can also be used if the @internalsref{DrumVoices} are instantiated by hand first. For example, @lilypond[quote,fragment,verbatim] -\drums \new DrumStaff << +\new DrumStaff << \context DrumVoice = "1" { s1 *2 } \context DrumVoice = "2" { s1 *2 } - { + \drums { bd4 sn4 bd4 sn4 << { \repeat unfold 16 hh16 } @@ -3573,11 +3572,11 @@ The complete example is shown here \notes \relative c'' \context Voice = duet { \time 3/4 g2 e4 a2 f4 g2. } - \lyrics << - \lyricsto "duet" \new Lyrics { + << + \lyricsto "duet" \new Lyrics \lyrics { \set vocalName = "Bert" Hi, my name is Bert. } - \lyricsto "duet" \new Lyrics { + \lyricsto "duet" \new Lyrics \lyrics { \set vocalName = "Ernie" Ooooo, ch\'e -- ri, je t'aime. } >> diff --git a/lily/parser.yy b/lily/parser.yy index 1930b93aa5..45dc82358b 100644 --- a/lily/parser.yy +++ b/lily/parser.yy @@ -909,7 +909,12 @@ Simple_music: optional_context_mod: /**/ { $$ = SCM_EOL; } - | WITH '{' context_mod_list '}' { $$ = $3; } + | WITH { THIS->lexer_->push_initial_state (); } + '{' context_mod_list '}' + { + THIS->lexer_->pop_state (); + $$ = $4; + } ; grace_head: @@ -1081,13 +1086,20 @@ basic music objects too, since the meaning is different. SCM nn = THIS->lexer_->lookup_identifier ("drumPitchNames"); THIS->lexer_->push_note_state (alist_to_hashq (nn)); } + /* FIXME: This used to be: Music +*/ + Grouped_music_list { $$ = $3; THIS->lexer_->pop_state (); } | FIGURES { THIS->lexer_->push_figuredbass_state (); } + /* FIXME: This used to be: Music + but that breaks web build + */ + Grouped_music_list { Music *chm = MY_MAKE_MUSIC ("UntransposableMusic"); chm->set_property ("element", $3->self_scm ()); @@ -1102,7 +1114,12 @@ basic music objects too, since the meaning is different. nn = THIS->lexer_->lookup_identifier ("pitchnames"); THIS->lexer_->push_chord_state (alist_to_hashq (nn)); - } Music { + } + /* FIXME: + Music +*/ + Grouped_music_list + { Music *chm = MY_MAKE_MUSIC ("UnrelativableMusic"); chm->set_property ("element", $3->self_scm ()); scm_gc_unprotect_object ($3->self_scm ()); @@ -1112,7 +1129,10 @@ basic music objects too, since the meaning is different. } | LYRICS { THIS->lexer_->push_lyric_state (); } + /* FIXME: Music +*/ + Grouped_music_list { $$ = $3; THIS->lexer_->pop_state (); @@ -1218,12 +1238,6 @@ context_change: } ; -simple_string: STRING { - } - | LYRICS_STRING { - } - ; - property_operation: STRING '=' scalar { $$ = scm_list_3 (ly_symbol2scm ("assign"), @@ -1313,16 +1327,43 @@ music_property_def: ; +string: + STRING { + $$ = $1; + } + | STRING_IDENTIFIER { + $$ = $1; + } + | string '+' string { + $$ = scm_string_append (scm_list_2 ($1, $3)); + } + ; -scalar: - string { $$ = $1; } - | bare_int { $$ = scm_int2num ($1); } - | embedded_scm { $$ = $1; } - | full_markup { $$ = $1; } - | DIGIT { $$ = scm_int2num ($1); } +simple_string: STRING { + } + | LYRICS_STRING { + } + ; + +scalar: string { + } + | LYRICS_STRING { + } + | bare_int { + $$ = scm_int2num ($1); + } + | embedded_scm { + } + | full_markup { + } + | DIGIT { + $$ = scm_int2num ($1); + } ; /* +FIXME: remove or fix this comment. What is `This'? + This is a trick: Adding pre_events to the simple_element @@ -1946,9 +1987,6 @@ steno_duration: } ; - - - multiplied_duration: steno_duration { $$ = $1; @@ -1979,7 +2017,6 @@ dots: } ; - tremolo_type: ':' { $$ = 0; @@ -1991,11 +2028,6 @@ tremolo_type: } ; - - -/***************************************************************** - BASS FIGURES -*****************************************************************/ bass_number: DIGIT { $$ = scm_number_to_string (scm_int2num ($1), scm_int2num (10)); @@ -2346,20 +2378,6 @@ bare_int: } ; - -string: - STRING { - $$ = $1; - } - | STRING_IDENTIFIER { - $$ = $1; - } - | string '+' string { - $$ = scm_string_append (scm_list_2 ($1, $3)); - } - ; - - exclamations: { $$ = 0; } | exclamations '!' { $$ ++; }