From: fred Date: Tue, 26 Mar 2002 23:56:39 +0000 (+0000) Subject: lilypond-1.3.93 X-Git-Tag: release/1.5.59~1273 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=b37a3a493c41586d800b6e4a740368d7a759edea;p=lilypond.git lilypond-1.3.93 --- diff --git a/input/test/parse.ly b/input/test/parse.ly new file mode 100644 index 0000000000..fda93852c6 --- /dev/null +++ b/input/test/parse.ly @@ -0,0 +1,3 @@ +% Test parser error + +\score{ diff --git a/input/test/parse2.ly b/input/test/parse2.ly new file mode 100644 index 0000000000..41ef087e29 --- /dev/null +++ b/input/test/parse2.ly @@ -0,0 +1,7 @@ +% Test parser error + +foo = \notes{ + + +\score{ +} diff --git a/input/test/parse3.ly b/input/test/parse3.ly new file mode 100644 index 0000000000..3b401890be --- /dev/null +++ b/input/test/parse3.ly @@ -0,0 +1,7 @@ +% Test parser error + +foo = \notes{ + + +\score{ + diff --git a/input/test/parse4.ly b/input/test/parse4.ly new file mode 100644 index 0000000000..1194381dcb --- /dev/null +++ b/input/test/parse4.ly @@ -0,0 +1,10 @@ +% Test parser error + +foo = \notes{ +} + + +\score{ + burp +} + diff --git a/lily/my-lily-parser.cc b/lily/my-lily-parser.cc index faf2a68b86..7fe85f3dab 100644 --- a/lily/my-lily-parser.cc +++ b/lily/my-lily-parser.cc @@ -52,7 +52,7 @@ My_lily_parser::parse_file (String init, String s) if (!define_spot_array_.empty()) { - warning (_ ("Braces don't match")); + define_spot_array_.top ().warning (_ ("Braces don't match")); error_level_i_ = 1; } diff --git a/lily/parser.yy b/lily/parser.yy index 13fd818479..e02e0047eb 100644 --- a/lily/parser.yy +++ b/lily/parser.yy @@ -269,9 +269,13 @@ yylex (YYSTYPE *s, void * v_l) mudela: /* empty */ | mudela toplevel_expression {} | mudela assignment { } - | mudela error + | mudela error { + THIS->error_level_i_ = 1; + //THIS->parser_error (_ ("ly invalid")); + } | mudela INVALID { - THIS->error_level_i_ =1; + THIS->error_level_i_ = 1; + //THIS->parser_error (_ ("ly invalid")); } ; @@ -474,8 +478,10 @@ translator_spec_body: */ score_block: SCORE { + THIS->remember_spot (); } /*cont*/ '{' score_body '}' { + THIS->pop_spot (); $$ = $4; if (!$$->def_p_arr_.size ()) { @@ -484,6 +490,15 @@ score_block: $$->add_output (id ? id->access_content_Music_output_def (true) : new Paper_def ); } } +/* + | SCORE '{' score_body error { + $$ = $3 + $$->set_spot (THIS->here_input ()); + // THIS->here_input ().error ("SCORE INVALID"); + $$->error ("SCORE INVALID"); + THIS->parser_error (_f ("SCORE ERROR")); + } +*/ ; score_body: @@ -1378,16 +1393,25 @@ simple_element: $$ = new Sequential_music (ms); } - | STRING optional_notemode_duration { - if (!THIS->lexer_p_->lyric_state_b ()) - THIS->parser_error (_ ("Have to be in Lyric mode for lyrics")); + | STRING { + THIS->remember_spot (); + } + /* cont */ + optional_notemode_duration { + if (!THIS->lexer_p_->lyric_state_b ()) { + THIS->pop_spot ().error (_ ("Have to be in Lyric mode for lyrics")); + THIS->error_level_i_ = 1; + THIS->parser_error (_ ("Giving up")); + } + else + THIS->pop_spot (); Lyric_req* lreq_p = new Lyric_req; lreq_p ->text_str_ = ly_scm2string ($1); - lreq_p->duration_ = *$2; + lreq_p->duration_ = *$3; lreq_p->set_spot (THIS->here_input()); Simultaneous_music* velt_p = new Request_chord (gh_list (lreq_p->self_scm (), SCM_UNDEFINED)); - delete $2; // ugh + delete $3; // ugh $$= velt_p; } diff --git a/lily/slur-engraver.cc b/lily/slur-engraver.cc index 8fe4f5de85..b993e907f3 100644 --- a/lily/slur-engraver.cc +++ b/lily/slur-engraver.cc @@ -19,6 +19,7 @@ class Slur_engraver : public Engraver Link_array new_slur_req_l_arr_; Link_array slur_l_stack_; Link_array end_slur_l_arr_; + Moment last_start_; void set_melisma (bool); @@ -32,8 +33,14 @@ protected: public: VIRTUAL_COPY_CONS (Translator); + Slur_engraver (); }; +Slur_engraver::Slur_engraver () +{ + last_start_ = Moment (-1); +} + bool Slur_engraver::do_try_music (Music *req_l) { @@ -56,8 +63,23 @@ Slur_engraver::do_try_music (Music *req_l) } else if (sl->span_type_str_ == "slur") { - new_slur_req_l_arr_.push (sl); - return true; + /* + Let's not start more than one slur per moment. + */ + if (sl->span_dir_ == START) + { + if (now_mom () > last_start_) + { + new_slur_req_l_arr_.push (sl); + last_start_ = now_mom (); + return true; + } + } + else + { + new_slur_req_l_arr_.push (sl); + return true; + } } } return false; diff --git a/mutopia/Coriolan/fagotto-2.ly b/mutopia/Coriolan/fagotto-2.ly index c7c5f77070..4156cd812c 100644 --- a/mutopia/Coriolan/fagotto-2.ly +++ b/mutopia/Coriolan/fagotto-2.ly @@ -212,6 +212,8 @@ fagottoII = \notes \relative c { \!f'2\ff e| dis b~| b1\p| + \property VoiceCombineVoice.crescendoText = "cresc." + \property VoiceCombineVoice.crescendoSpanner = "dashed-line" a\<| g| f|