From: David Kastrup Date: Tue, 10 Sep 2013 09:46:05 +0000 (+0200) Subject: Issue 3547: Allow identifiers or scheme expressions evaluating to music after \with X-Git-Tag: release/2.17.27-1~33 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=4dc7d485f7e3703997025419c2255f1160c3ffb9;p=lilypond.git Issue 3547: Allow identifiers or scheme expressions evaluating to music after \with This permits writing \with \voiceOne instead of \with { \voiceOne } which is mostly handy in the context of music/scheme function arguments. --- diff --git a/lily/parser.yy b/lily/parser.yy index dd0f09fb93..daf25c94ae 100644 --- a/lily/parser.yy +++ b/lily/parser.yy @@ -1146,8 +1146,12 @@ context_modification: { $$ = $1; } - | WITH embedded_scm_closed + | WITH context_modification_arg { + if (unsmob_music ($2)) { + SCM proc = parser->lexer_->lookup_identifier ("context-mod-music-handler"); + $2 = scm_call_2 (proc, parser->self_scm (), $2); + } if (unsmob_context_mod ($2)) $$ = $2; else { @@ -1157,6 +1161,11 @@ context_modification: } ; +context_modification_arg: + embedded_scm_closed + | MUSIC_IDENTIFIER + ; + optional_context_mod: /**/ { $$ = SCM_EOL;