/* escaped */
%token E_CHAR E_EXCLAMATION E_SMALLER E_BIGGER E_OPEN E_CLOSE E_TILDE
+%token E_BACKSLASH
%token CHORD_BASS CHORD_COLON CHORD_MINUS CHORD_CARET
%type <i> exclamations questions dots
%type <scm> identifier_init
%type <scm> steno_duration optional_notemode_duration multiplied_duration
-%type <scm> explicit_duration
+%type <scm> verbose_duration
%type <reqvec> pre_requests post_requests
%type <request> gen_text_def
$$ = $1->self_scm ();
scm_gc_unprotect_object ($$);
}
- | explicit_duration {
+ | verbose_duration {
$$ = $1;
}
| number_expression {
THIS->push_spot ();
} /*cont */ simple_element post_requests {
Music_sequence *l = dynamic_cast<Music_sequence*> ($3);
- if (l) {
- for (int i=0; i < $1->size (); i++)
- l->append_music ($1->elem (i));
- for (int i=0; i < $4->size (); i++)
- l->append_music ($4->elem (i));
- }
- else
- programming_error ("Need Sequence to add music to");
+
+ $1->concat (*$4);
+ for (int i=0; i < $1->size (); i++) {
+ Music * m = $1->elem (i);
+ l->append_music (m);
+ }
$$ = $3;
+
+ delete $1;
+ delete $4;
}
| command_element
;
$$-> set_spot (THIS->here_input ());
$1-> set_spot (THIS->here_input ());
}
+ | E_BACKSLASH {
+ $$ = new Music (gh_list (gh_cons (ly_symbol2scm ("name"), ly_symbol2scm ("separator")), SCM_UNDEFINED));
+ $$->set_spot (THIS->here_input ());
+ }
+ | '|' {
+
+ extern Music * get_barcheck();
+ $$ = get_barcheck ();
+ $$->set_spot (THIS->here_input ());
+ }
| BAR STRING {
Music *t = set_property_music (ly_symbol2scm ("whichBar"), $2);
| hyphen_req {
$$ = $1;
}
- | '|' {
- $$ = new Barcheck_req;
- }
| '~' {
$$ = new Tie_req;
}
b->set_span_dir (START);
b->set_mus_property ("span-type", ly_str02scm ("beam"));
$$ =b;
+
+
+ THIS->last_beam_start_ = b->self_scm ();
}
| ']' {
Span_req*b= new Span_req;
}
| PENALTY SCM_T {
-
-
Break_req * b = new Break_req;
SCM s = $2;
if (!gh_number_p (s))
}
;
-explicit_duration:
+verbose_duration:
DURATION embedded_scm {
$$ = $2;
if (!unsmob_duration ($2))
}
;
-
script_dir:
'_' { $$ = DOWN; }
| '^' { $$ = UP; }
multiplied_duration {
$$ = $1;
}
- | explicit_duration {
+ | verbose_duration {
$$ = $1;
}
;
optional_notemode_duration:
{
- $$ = THIS->default_duration_.smobbed_copy ();
+ Duration dd = THIS->default_duration_;
+ $$ = dd.smobbed_copy ();
+
+ THIS->beam_check ($$);
}
| multiplied_duration {
$$ = $1;
THIS->default_duration_ = *unsmob_duration ($$);
+
+ THIS->beam_check ($$);
}
- | explicit_duration {
+ | verbose_duration {
$$ = $1;
THIS->default_duration_ = *unsmob_duration ($$);
}
}
+/*
+Should make this optional? It will also complain when you do
+
+ [s4]
+
+which is entirely legitimate.
+
+Or we can scrap it. Barchecks should detect wrong durations, and
+skipTypesetting speeds it up a lot.
+*/
+void
+My_lily_parser::beam_check (SCM dur)
+{
+ Duration *d = unsmob_duration (dur);
+ if (unsmob_music (last_beam_start_) && d->duration_log () <= 2)
+ {
+ Music * m = unsmob_music (last_beam_start_);
+ m->origin ()->warning (_("Suspect duration found following this beam"));
+ }
+ last_beam_start_ = SCM_EOL;
+}