]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-0.1.42
authorfred <fred>
Sun, 24 Mar 2002 20:05:05 +0000 (20:05 +0000)
committerfred <fred>
Sun, 24 Mar 2002 20:05:05 +0000 (20:05 +0000)
init/lily-init.ly
lily/include/my-lily-parser.hh
lily/my-lily-parser.cc

index 8b19863c64e07d670e62f3eb3ee7aebc8a7308cf..97c252cbd925a42dfa25e6770c03f2a9fe20c88b 100644 (file)
@@ -1,6 +1,6 @@
 % Toplevel initialisation file. 
        
-\version "0.1.7";
+\version "0.1.8";
   
 breve = \duration { -1 0 }
 longa = \duration { -2 0 }
index b0666e160ade4a26948cad5e9cb0f85e0a4d58fb..b5cbd87154e8fdc594b257008156cd84faa26378 100644 (file)
@@ -66,7 +66,7 @@ public:
   void parser_error (String);
   void clear_notenames();
 
-  Request* get_parens_request (char c);
+  Array<Request*>* get_parens_request (int t);
     
   void set_debug();
   void set_yydebug (bool);
index 1c1f31860bb89e33b89f6a5d1fcfbe4a55634112..aaaf7201b2c5a1fdc39f4e25ff3621a7ab1bdef1 100644 (file)
@@ -225,79 +225,101 @@ My_lily_parser::get_note_element (Note_req *rq, Duration * duration_p)
   return v;
 }
 
-Request*
-My_lily_parser::get_parens_request (char c)
+Array<Request*>*
+My_lily_parser::get_parens_request (int t)
 {
-  Request* req_p=0;
-  switch (c)
+  Array<Request*>& reqs = *new Array<Request*>;
+  switch (t)
     {
-
     case '~':
-      req_p = new Tie_req;
+      reqs.push (new Tie_req);
       break;
+    case BEAMPLET:
+    case MAEBTELP:
+      {
+       Plet_req* p = new Plet_req;
+       p->plet_i_ = plet_.type_i_;
+       reqs.push (p);
+      }
+      /* fall through */
     case '[':
     case ']':
       {
        if (!abbrev_beam_type_i_)
          {
-           Beam_req*b = new Beam_req;
-           int p_i=plet_.type_i_ ; // ugh . Should junk?
-           if (p_i!= 1)
-             b->nplet = p_i;
-           req_p = b;
+           reqs.push (new Beam_req);
          }
        else
          {
            Abbreviation_beam_req* a = new Abbreviation_beam_req;
            a->type_i_ = abbrev_beam_type_i_;
-           if (c==']')
+           if (t==']')
              abbrev_beam_type_i_ = 0;
-           req_p = a;
+           reqs.push (a);
          }
       }
-    break;
+      break;
 
     case '>':
     case '!':
     case '<':
-      req_p = new Span_dynamic_req;
+      reqs.push (new Span_dynamic_req);
       break;
 
+    case PLET:  
+    case TELP:
+      {
+       Plet_req* p = new Plet_req;
+       p->plet_i_ = plet_.type_i_;
+       reqs.push (p);
+      }
+      break;
     case ')':
     case '(':
-      req_p = new Slur_req;
+      {
+       reqs.push (new Slur_req);
+      }
       break;
     default:
       assert (false);
       break;
     }
 
-  switch (c)
+  switch (t)
     {
+    case BEAMPLET:
+      reqs.top ()->span()->spantype = Span_req::START;
+      /* fall through */
     case '<':
     case '>':
     case '(':
     case '[':
-      req_p->span()->spantype = Span_req::START;
+    case PLET:
+      reqs[0]->span ()->spantype = Span_req::START;
       break;
+    case MAEBTELP:
+      reqs.top ()->span()->spantype = Span_req::STOP;
+      /* fall through */
     case '!':
     case ')':
     case ']':
-      req_p->span()->spantype = Span_req::STOP;
+      reqs[0]->span ()->spantype = Span_req::STOP;
       break;
 
     default:
       break;
     }
 
-  if (req_p->musical()->span_dynamic ())
-    {
-      Span_dynamic_req* s_l= (req_p->musical()->span_dynamic ()) ;
-      s_l->dynamic_dir_ = (c == '<') ? UP:DOWN;
-    }
+  for (int i = 0; i < reqs.size (); i++)
+    if (reqs[i]->musical ()->span_dynamic ())
+      {
+       Span_dynamic_req* s_l= (reqs[i]->musical ()->span_dynamic ()) ;
+       s_l->dynamic_dir_ = (t == '<') ? UP:DOWN;
+      }
 
-  req_p->set_spot (here_input());
-  return req_p;
+  // ugh? don't we do this in the parser too?
+  reqs[0]->set_spot (here_input());
+  return &reqs;
 }
 
 void