A music expression could start with BACKUP (an artificially inserted
token never present in the source code itself) due to the previous
rules. If the BACKUP mechanism is needed in different unrelated rules
applicable in similar contexts, this can lead to shift/reduce
conflicts.
While the actual (separate) code prompting this issue was rewritten in
a manner reining its BACKUP tokens in on its own and thus avoiding the
conflict triggering this issue, it still makes sense to confine the
range where BACKUP tokens are recognized to the actual limited
contexts where they are being produced, in order to keep such
conflicts down, and to stop the parser from creative reinterpretation
of situations that can only arise by programmer error.
// \revert Accidental.color
revert_arg:
+ revert_arg_backup BACKUP symbol_list_arg
+ {
+ $$ = $3;
+ }
+ ;
+
+revert_arg_backup:
revert_arg_part
{
if (scm_is_null ($1)
else
MYBACKUP (SYMBOL_LIST, scm_reverse_x ($1, SCM_EOL), @1);
}
- | revert_arg BACKUP symbol_list_arg
- {
- $$ = $3;
- }
;
// revert_arg_part delivers results in reverse
revert_arg_part:
symbol_list_part
- | revert_arg BACKUP SCM_ARG '.' symbol_list_part
+ | revert_arg_backup BACKUP SCM_ARG '.' symbol_list_part
{
$$ = scm_append_x (scm_list_2 ($5, $3));
}
- | revert_arg BACKUP SCM_ARG symbol_list_part
+ | revert_arg_backup BACKUP SCM_ARG symbol_list_part
{
$$ = scm_append_x (scm_list_2 ($4, $3));
}