From a127c4920f53a24b46957416a5f86cf78eece1bc Mon Sep 17 00:00:00 2001 From: Devon Schudy Date: Fri, 6 Dec 2013 16:14:46 -0500 Subject: [PATCH] Make parsing of articulation shorthands more robust. (issue 3664) 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 --- lily/parser.yy | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lily/parser.yy b/lily/parser.yy index 79a4b1114f..f90dfd0799 100644 --- a/lily/parser.yy +++ b/lily/parser.yy @@ -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")); + } } ; -- 2.39.5