]> git.donarmstrong.com Git - lilypond.git/commitdiff
patch::: 1.3.92.jcn1
authorJan Nieuwenhuizen <janneke@gnu.org>
Mon, 2 Oct 2000 20:45:38 +0000 (22:45 +0200)
committerJan Nieuwenhuizen <janneke@gnu.org>
Mon, 2 Oct 2000 20:45:38 +0000 (22:45 +0200)
1.3.92.jcn2
===========

* Added some error messages for toplevel and stray string parse errors.

* Don't start more than one slur at a time.

* Set direction of Slur too in a2-engraver.

CHANGES
VERSION
input/test/parse.ly [new file with mode: 0644]
input/test/parse2.ly [new file with mode: 0644]
input/test/parse3.ly [new file with mode: 0644]
input/test/parse4.ly [new file with mode: 0644]
lily/a2-engraver.cc
lily/my-lily-parser.cc
lily/parser.yy
lily/slur-engraver.cc
mutopia/Coriolan/fagotto-2.ly

diff --git a/CHANGES b/CHANGES
index 5282a4ded37286508088fa7dc8bfd6a309b6d333..06efe0291be7a8d83b156a0a4ff5b86f90f21144 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,12 @@
+1.3.92.jcn2
+===========
+
+* Added some error messages for toplevel and stray string parse errors.
+
+* Don't start more than one slur at a time.
+
+* Set direction of Slur too in a2-engraver.
+
 1.3.91.uu1
 ==========
 
diff --git a/VERSION b/VERSION
index 82c759db9c9062f730cf71c671d56308c1eb040c..9e33a40e75234c18ce0d7ffe9dd44a47bd5899c8 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -2,7 +2,7 @@ PACKAGE_NAME=LilyPond
 MAJOR_VERSION=1
 MINOR_VERSION=3
 PATCH_LEVEL=92
-MY_PATCH_LEVEL=
+MY_PATCH_LEVEL=jcn1
 
 # use the above to send patches: MY_PATCH_LEVEL is always empty for a
 # released version.
diff --git a/input/test/parse.ly b/input/test/parse.ly
new file mode 100644 (file)
index 0000000..fda9385
--- /dev/null
@@ -0,0 +1,3 @@
+% Test parser error
+
+\score{
diff --git a/input/test/parse2.ly b/input/test/parse2.ly
new file mode 100644 (file)
index 0000000..41ef087
--- /dev/null
@@ -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 (file)
index 0000000..3b40189
--- /dev/null
@@ -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 (file)
index 0000000..1194381
--- /dev/null
@@ -0,0 +1,10 @@
+% Test parser error
+
+foo = \notes{
+}
+
+
+\score{
+  burp
+}
+
index 18d5bbb54b3036d56865bc8ce4bcd744630c4e70..88d86648c6e2c4ef500cede3e81459e5f13cadb0 100644 (file)
@@ -10,6 +10,7 @@
 #include "item.hh"
 #include "note-head.hh"
 #include "stem.hh"
+#include "slur.hh"
 #include "translator-group.hh"
 #include "side-position-interface.hh"
 #include "directional-element-interface.hh"
@@ -126,10 +127,12 @@ A2_engraver::acknowledge_element (Score_element_info i)
   else if (unirhythm)
     state_ = UNIRHYTHM;
          
-  if (Stem::has_interface (i.elem_l_))
+  if (Stem::has_interface (i.elem_l_)
+      || Slur::has_interface (i.elem_l_)
+      // || Text_item::has_interface (i.elem_l_)
+      //|| Crescendo::has_interface (i.elem_l_)
+      )
     {
-      Item *stem_l = dynamic_cast<Item*> (i.elem_l_);
-
       /*
        Hmm.  We must set dir when solo, in order to get
        the rests collided to the right position
@@ -141,11 +144,11 @@ A2_engraver::acknowledge_element (Score_element_info i)
        {
          if (daddy_trans_l_->id_str_ == "one")
            {
-             stem_l->set_elt_property ("direction", gh_int2scm (1));
+             i.elem_l_->set_elt_property ("direction", gh_int2scm (1));
            }
          else if (daddy_trans_l_->id_str_ == "two")
            {
-             stem_l->set_elt_property ("direction", gh_int2scm (-1));
+             i.elem_l_->set_elt_property ("direction", gh_int2scm (-1));
            }
        }
     }
index faf2a68b862c8bd234881e70d3d5ef01a83233b5..7fe85f3dab2ccb6370caf7be6db0580fff4c8f6d 100644 (file)
@@ -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;
     }
 
index 13fd8184796d9667f048df69e233666db7156314..e02e0047eb6b7eb176ead47e21567f027ec67d27 100644 (file)
@@ -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;
 
        }
index 8fe4f5de8510cb43b9ebaa6b88954c0f47aedfbf..b993e907f312555e982e4753cb2e8bb771cc80a5 100644 (file)
@@ -19,6 +19,7 @@ class Slur_engraver : public Engraver
   Link_array<Span_req> new_slur_req_l_arr_;
   Link_array<Score_element> slur_l_stack_;
   Link_array<Score_element> 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;
index c7c5f77070fe8af5f7368092a01eef8436339706..4156cd812c57236902ef4eb8d4c67465e96e890b 100644 (file)
@@ -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|