From 4dc7d485f7e3703997025419c2255f1160c3ffb9 Mon Sep 17 00:00:00 2001 From: David Kastrup Date: Tue, 10 Sep 2013 11:46:05 +0200 Subject: [PATCH] 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. --- lily/parser.yy | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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; -- 2.39.2