]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/parser.yy
Merge branch 'master' into lilypond/translation
[lilypond.git] / lily / parser.yy
index e913d88cf1df3ecfe52e41f136643026d9c58687..22a45b279786e62e8fc0d5156d4b5647634fcc2e 100644 (file)
@@ -46,7 +46,7 @@
 %lex-param {Lily_parser *parser}
 
 /* We use SCMs to do strings, because it saves us the trouble of
-deleting them.  Let's hope that a stack overflow doesnt trigger a move
+deleting them.  Let's hope that a stack overflow doesn't trigger a move
 of the parse stack onto the heap. */
 
 %left PREC_BOT
@@ -2037,8 +2037,9 @@ scalar_closed:
 event_chord:
        simple_element post_events {
                // Let the rhythmic music iterator sort this mess out.
-               unsmob_music ($1)->set_property ("articulations",
-                                                scm_reverse_x ($2, SCM_EOL));
+               if (scm_is_pair ($2))
+                       unsmob_music ($1)->set_property ("articulations",
+                                                        scm_reverse_x ($2, SCM_EOL));
        }
        | simple_chord_elements post_events     {
                SCM elts = ly_append2 ($1, scm_reverse_x ($2, SCM_EOL));
@@ -2146,7 +2147,14 @@ chord_body_element:
        }
        | music_function_chord_body
        {
-               if (!unsmob_music ($$)->is_mus_type ("rhythmic-event")) {
+               Music *m = unsmob_music ($1);
+
+               while (m && m->is_mus_type ("music-wrapper-music")) {
+                       $$ = m->get_property ("element");
+                       m = unsmob_music ($$);
+               }
+
+               if (!(m && m->is_mus_type ("rhythmic-event"))) {
                        parser->parser_error (@$, _ ("not a rhythmic event"));
                        $$ = SCM_UNDEFINED;
                }
@@ -2759,8 +2767,9 @@ lyric_element_arg:
        lyric_element
        | lyric_element multiplied_duration post_events {
                $$ = MAKE_SYNTAX ("lyric-event", @$, $1, $2);
-               unsmob_music ($$)->set_property
-                       ("articulations", scm_reverse_x ($3, SCM_EOL));
+               if (scm_is_pair ($3))
+                       unsmob_music ($$)->set_property
+                               ("articulations", scm_reverse_x ($3, SCM_EOL));
        }
        | lyric_element post_event post_events {
                $$ = MAKE_SYNTAX ("lyric-event", @$, $1,
@@ -2770,8 +2779,9 @@ lyric_element_arg:
        }
        | LYRIC_ELEMENT optional_notemode_duration post_events {
                $$ = MAKE_SYNTAX ("lyric-event", @$, $1, $2);
-               unsmob_music ($$)->set_property
-                       ("articulations", scm_reverse_x ($3, SCM_EOL));
+               if (scm_is_pair ($3))
+                       unsmob_music ($$)->set_property
+                               ("articulations", scm_reverse_x ($3, SCM_EOL));
        }
        ;
 
@@ -2779,8 +2789,9 @@ lyric_element_arg:
 lyric_element_music:
        lyric_element optional_notemode_duration post_events {
                $$ = MAKE_SYNTAX ("lyric-event", @$, $1, $2);
-               unsmob_music ($$)->set_property
-                       ("articulations", scm_reverse_x ($3, SCM_EOL));
+               if (scm_is_pair ($3))
+                       unsmob_music ($$)->set_property
+                               ("articulations", scm_reverse_x ($3, SCM_EOL));
        }
        ;