+ | EXPECT_OPTIONAL EXPECT_SCM function_arglist_keep lyric_element
+ {
+ // There is no point interpreting a lyrics string as
+ // an event, since we don't allow music possibly
+ // followed by durations or postevent into closed
+ // music, and we only accept closed music in optional
+ // arguments at the moment. If this changes, more
+ // complex schemes might become interesting here as
+ // well: see how we do this at the mandatory argument
+ // point.
+ if (scm_is_true (scm_call_1 ($2, $4)))
+ $$ = scm_cons ($4, $3);
+ else {
+ $$ = scm_cons (loc_on_music (@3, $1), $3);
+ MYBACKUP (LYRICS_STRING, $4, @4);
+ }
+ }
+ | EXPECT_OPTIONAL EXPECT_SCM function_arglist_closed_keep UNSIGNED
+ {
+ if (scm_is_true (scm_call_1 ($2, $4)))
+ {
+ $$ = $3;
+ MYREPARSE (@4, $2, UNSIGNED, $4);
+ } else {
+ $$ = scm_cons (loc_on_music (@3, $1), $3);
+ MYBACKUP (UNSIGNED, $4, @4);
+ }
+ }
+ | EXPECT_OPTIONAL EXPECT_SCM function_arglist_closed_keep REAL
+ {
+ if (scm_is_true (scm_call_1 ($2, $4)))
+ {
+ $$ = $3;
+ MYREPARSE (@4, $2, REAL, $4);
+ } else {
+ $$ = scm_cons (loc_on_music (@3, $1), $3);
+ MYBACKUP (REAL, $4, @4);
+ }
+ }
+ | EXPECT_OPTIONAL EXPECT_SCM function_arglist_closed_keep NUMBER_IDENTIFIER
+ {
+ if (scm_is_true (scm_call_1 ($2, $4)))
+ {
+ $$ = scm_cons ($4, $3);
+ } else {
+ $$ = scm_cons (loc_on_music (@3, $1), $3);
+ MYBACKUP (NUMBER_IDENTIFIER, $4, @4);
+ }
+ }
+ | EXPECT_OPTIONAL EXPECT_SCM function_arglist_closed_keep FRACTION
+ {
+ if (scm_is_true (scm_call_1 ($2, $4)))
+ {
+ $$ = scm_cons ($4, $3);
+ } else {
+ $$ = scm_cons (loc_on_music (@3, $1), $3);
+ MYBACKUP (FRACTION, $4, @4);
+ }
+ }
+ | EXPECT_OPTIONAL EXPECT_SCM function_arglist_closed_keep '-' UNSIGNED
+ {
+ SCM n = scm_difference ($5, SCM_UNDEFINED);
+ if (scm_is_true (scm_call_1 ($2, n))) {
+ $$ = $3;
+ MYREPARSE (@5, $2, REAL, n);
+ } else {
+ Music *t = MY_MAKE_MUSIC ("FingeringEvent", @5);
+ t->set_property ("digit", $5);
+ $$ = t->unprotect ();
+ if (scm_is_true (scm_call_1 ($2, $$)))
+ $$ = scm_cons ($$, $3);
+ else {
+ $$ = scm_cons (loc_on_music (@3, $1), $3);
+ MYBACKUP (UNSIGNED, $5, @5);
+ parser->lexer_->push_extra_token ('-');
+ }
+ }
+
+ }
+ | EXPECT_OPTIONAL EXPECT_SCM function_arglist_closed_keep '-' REAL
+ {
+ SCM n = scm_difference ($5, SCM_UNDEFINED);
+ if (scm_is_true (scm_call_1 ($2, n))) {
+ MYREPARSE (@5, $2, REAL, n);
+ $$ = $3;
+ } else {
+ MYBACKUP (REAL, n, @5);
+ }
+ }
+ | EXPECT_OPTIONAL EXPECT_SCM function_arglist_closed_keep '-' NUMBER_IDENTIFIER
+ {
+ SCM n = scm_difference ($5, SCM_UNDEFINED);
+ if (scm_is_true (scm_call_1 ($2, n))) {
+ $$ = scm_cons (n, $3);
+ } else {
+ MYBACKUP (NUMBER_IDENTIFIER, n, @5);
+ }
+ }
+ | EXPECT_OPTIONAL EXPECT_PITCH function_arglist_keep pitch_also_in_chords
+ {