%token BOOK_IDENTIFIER
%token CHORD_MODIFIER
%token CHORD_REPETITION
-%token CONTEXT_MOD_IDENTIFIER
%token DRUM_PITCH
/* Artificial token for durations in argument lists */
%token DURATION_ARG
parser->lexer_->pop_state ();
$$ = $4;
}
- | WITH CONTEXT_MOD_IDENTIFIER
- {
- $$ = $2;
- }
- | CONTEXT_MOD_IDENTIFIER
- {
- $$ = $1;
- }
| WITH context_modification_arg
{
if (unsmob<Music> ($2)) {
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 ();
}
}
if (!SCM_UNBNDP ($2))
unsmob<Context_mod> ($1)->add_context_mod ($2);
}
- | context_mod_list CONTEXT_MOD_IDENTIFIER {
- Context_mod *md = unsmob<Context_mod> ($2);
- if (md)
- 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"));
- }
}
;
}
} %prec ':'
| CHORD_REPETITION optional_notemode_duration post_events {
- Input i;
- i.set_location (@1, @3);
- $$ = MAKE_SYNTAX (repetition_chord, i,
+ $$ = MAKE_SYNTAX (repetition_chord, @$,
$2, scm_reverse_x ($3, SCM_EOL));
} %prec ':'
| MULTI_MEASURE_REST optional_notemode_duration post_events {
- Input i;
- i.set_location (@1, @3);
- $$ = MAKE_SYNTAX (multi_measure_rest, i, $2,
+ $$ = MAKE_SYNTAX (multi_measure_rest, @$, $2,
scm_reverse_x ($3, SCM_EOL));
} %prec ':'
| tempo_event
return SCM_IDENTIFIER;
} else if (unsmob<Context_mod> (sid)) {
*destination = unsmob<Context_mod> (sid)->smobbed_copy ();
- return CONTEXT_MOD_IDENTIFIER;
+ return SCM_IDENTIFIER;
} else if (Music *mus = unsmob<Music> (sid)) {
mus = mus->clone ();
*destination = mus->self_scm ();