[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Syntax: lyric_mode_music might be a MUSIC_FUNCTION (issue 343820043 by a
From: |
knupero |
Subject: |
Syntax: lyric_mode_music might be a MUSIC_FUNCTION (issue 343820043 by address@hidden) |
Date: |
Tue, 24 Apr 2018 23:33:19 -0700 |
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 <address@hidden>
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
;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Syntax: lyric_mode_music might be a MUSIC_FUNCTION (issue 343820043 by address@hidden),
knupero <=