In particular, so far the following did not work:
\new Staff { \m \addlyrics \l }
Instead, one had to use braces around \m and \l:
\new Staff { {\m} \addlyrics {\l} }
This patch extends the parser to allow music identifiers,
so that no braces are needed any more.
--- /dev/null
+\version "2.13.38"
+
+\header {
+ texidoc = "addlyrics do not need braces around their arguments,
+in particular if the arguments are variables."
+}
+
+m = \relative c' { c4 d }
+l = \lyricmode { A B }
+
+% addlyrics takes music expressions as well as music identifiers. The following
+% two staves should produce the same output:
+\new Staff { {\m} \addlyrics {\l} }
+\new Staff { \m \addlyrics \l }
$$ = scm_cons ($3, SCM_EOL);
}
$$ = 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 ();
} 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));
}
;
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 {
| LYRICSTO simple_string {
PARSER->lexer_->push_lyric_state ();
} music {