]> git.donarmstrong.com Git - lilypond.git/commitdiff
Issue 4911/1: \with #*unspecified* should be equivalent to \with { }
authorDavid Kastrup <dak@gnu.org>
Sat, 14 Sep 2013 19:12:38 +0000 (21:12 +0200)
committerDavid Kastrup <dak@gnu.org>
Sun, 10 Jul 2016 17:36:26 +0000 (19:36 +0200)
lily/parser.yy

index 52fe450b7d8c3848f87796d30469ac8bcb0b51bc..3601ea8f6a0f0cc1e78dabc6e75fce5a596ef9b6 100644 (file)
@@ -1511,7 +1511,10 @@ context_modification:
                if (unsmob<Context_mod> ($2))
                        $$ = $2;
                else {
-                       parser->parser_error (@2, _ ("not a context mod"));
+                       // let's permit \with #*unspecified* to go for
+                       // an empty context mod
+                       if (!scm_is_eq ($2, SCM_UNSPECIFIED))
+                               parser->parser_error (@2, _ ("not a context mod"));
                        $$ = Context_mod ().smobbed_copy ();
                }
        }
@@ -1570,18 +1573,15 @@ context_mod_list:
                      unsmob<Context_mod> ($1)->add_context_mods (md->get_mods ());
         }
        | context_mod_list context_mod_arg {
-               if (scm_is_eq ($2, SCM_UNSPECIFIED))
-                       ;
-               else if (unsmob<Music> ($2)) {
+               if (unsmob<Music> ($2)) {
                        SCM proc = parser->lexer_->lookup_identifier ("context-mod-music-handler");
                        $2 = scm_call_1 (proc, $2);
                }
                if (unsmob<Context_mod> ($2))
                        unsmob<Context_mod> ($$)->add_context_mods
                                (unsmob<Context_mod> ($2)->get_mods ());
-               else {
+               else if (!scm_is_eq ($2, SCM_UNSPECIFIED))
                        parser->parser_error (@2, _ ("not a context mod"));
-               }
         }
         ;