Reviewers: ,

Message:
Please test & review the proposed syntax change.

Description:
Syntax: lyric_mode_music might be a MUSIC_FUNCTION

With this patch, all four scores in the lilypond
source below use a valid syntax and produce correct
output.

Without this patch only the first two scores use
a valid syntax (an extra pair of curly brackets
would fix the problem).

  \version "2.21.0"

  music = \relative { c''2 2 }
  lyrics_dir = \lyricmode { foo bar }
  lyrics_fun = #(define-music-function () ()
                 #{ \lyricmode { foo bar } #})

  \score {\music \addlyrics { foo bar } \layout {}}
  \score {\music \addlyrics \lyrics_dir \layout {}}
  \score {\music \addlyrics \lyrics_fun \layout {}}
  \score {\music \addlyrics \displayLilyMusic
                            \lyrics_fun \layout {}}

Signed-off-by: Knut Petersen <knut_peter...@t-online.de>

Please review this at https://codereview.appspot.com/343820043/

Affected files (+7, -0 lines):
  M lily/parser.yy


Index: lily/parser.yy
diff --git a/lily/parser.yy b/lily/parser.yy
index 6422f5586bf0c9be52996ce87308833d8e7f355f..b127641c4182400a2be9e24005a5c8917ad62916 100644
--- a/lily/parser.yy
+++ b/lily/parser.yy
@@ -2624,6 +2624,13 @@ lyric_mode_music:
                parser->lexer_->pop_state ();
                $$ = $2;
        }
+       | {
+               parser->lexer_->push_lyric_state ();
+       } music_function_call
+       {
+               parser->lexer_->pop_state ();
+               $$ = $2;
+       }
        | MUSIC_IDENTIFIER
        ;




_______________________________________________
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel

Reply via email to