]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/parser.yy
Issue 3547: Allow identifiers or scheme expressions evaluating to music after \with
[lilypond.git] / lily / parser.yy
index dd0f09fb93cca4c0fb085d1ffac748f1d0228103..daf25c94ae1bb3ce0974d0ea48ba77b076fc7bf4 100644 (file)
@@ -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;