]> git.donarmstrong.com Git - lilypond.git/commitdiff
Make parsing of articulation shorthands more robust. (issue 3664)
authorDevon Schudy <dschudy@gmail.com>
Fri, 6 Dec 2013 21:14:46 +0000 (16:14 -0500)
committerDavid Kastrup <dak@gnu.org>
Wed, 18 Dec 2013 18:55:54 +0000 (19:55 +0100)
Allow articulation shorthands to be any post-event. Commit 6baa453 tried
to restrict them to ArticulationEvents, but actually allowed anything.

As opposed to previously, return a dummy PostEvents on error as
fallback rather than an incomplete ArticulationEvent causing followup
errors and a crash.

Signed-off-by: David Kastrup <dak@gnu.org>
lily/parser.yy

index 79a4b1114f214c70cd8942e8bd6273e1e417a880..f90dfd0799b5cea5c973fa05ea5950add6e7cec5 100644 (file)
@@ -2818,14 +2818,17 @@ direction_reqd_event:
                        Music *a = MY_MAKE_MUSIC ("ArticulationEvent", @$);
                        a->set_property ("articulation-type", s);
                        $$ = a->unprotect ();
-               } else if (ly_prob_type_p (s, ly_symbol2scm ("ArticulationEvent"))) {
-                       $$ = s;
-                       if (Music *original = unsmob_music (s)) {
+               } else {
+                       Music *original = unsmob_music (s);
+                       if (original && original->is_mus_type ("post-event")) {
                                Music *a = original->clone ();
                                a->set_spot (parser->lexer_->override_input (@$));
                                $$ = a->unprotect ();
+                       } else {
+                               parser->parser_error (@1, _ ("expecting string or post-event as script definition"));
+                               $$ = MY_MAKE_MUSIC ("PostEvents", @$)->unprotect ();
                        }
-               } else parser->parser_error (@1, _ ("expecting string or ArticulationEvent as script definition"));
+               }
        }
        ;