From: fred Date: Sun, 24 Mar 2002 20:05:05 +0000 (+0000) Subject: lilypond-0.1.42 X-Git-Tag: release/1.5.59~3474 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=c5bb4d52dcb628a7d4886a1f63f033d094b110bf;p=lilypond.git lilypond-0.1.42 --- diff --git a/init/lily-init.ly b/init/lily-init.ly index 8b19863c64..97c252cbd9 100644 --- a/init/lily-init.ly +++ b/init/lily-init.ly @@ -1,6 +1,6 @@ % Toplevel initialisation file. -\version "0.1.7"; +\version "0.1.8"; breve = \duration { -1 0 } longa = \duration { -2 0 } diff --git a/lily/include/my-lily-parser.hh b/lily/include/my-lily-parser.hh index b0666e160a..b5cbd87154 100644 --- a/lily/include/my-lily-parser.hh +++ b/lily/include/my-lily-parser.hh @@ -66,7 +66,7 @@ public: void parser_error (String); void clear_notenames(); - Request* get_parens_request (char c); + Array* get_parens_request (int t); void set_debug(); void set_yydebug (bool); diff --git a/lily/my-lily-parser.cc b/lily/my-lily-parser.cc index 1c1f31860b..aaaf7201b2 100644 --- a/lily/my-lily-parser.cc +++ b/lily/my-lily-parser.cc @@ -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* +My_lily_parser::get_parens_request (int t) { - Request* req_p=0; - switch (c) + Array& reqs = *new Array; + 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