From b705c9024035a17664071ceea3c44beb53d56be3 Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Fri, 10 Aug 2001 00:46:12 +0200 Subject: [PATCH] patch::: 1.5.4.jcn2 1.5.4.jcn2 --- CHANGES | 4 +- VERSION | 2 +- lily/include/my-lily-parser.hh | 2 +- lily/my-lily-parser.cc | 2 +- lily/parser.yy | 70 +++++++++++++++++----------------- 5 files changed, 41 insertions(+), 39 deletions(-) diff --git a/CHANGES b/CHANGES index cdd2e4841b..3ca78e9e6f 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,8 @@ -1.5.4.jcn1 +1.5.4.jcn2 ========== +* Fixed off by one error for point and click. + * Website fixes, found bug in grace note stem lengths. 1.5.4 diff --git a/VERSION b/VERSION index 706c6e07de..5bfd0ea4fb 100644 --- a/VERSION +++ b/VERSION @@ -2,7 +2,7 @@ PACKAGE_NAME=LilyPond MAJOR_VERSION=1 MINOR_VERSION=5 PATCH_LEVEL=4 -MY_PATCH_LEVEL=jcn1 +MY_PATCH_LEVEL=jcn2 # use the above to send patches: MY_PATCH_LEVEL is always empty for a # released version. diff --git a/lily/include/my-lily-parser.hh b/lily/include/my-lily-parser.hh index 0e8b8f2b86..b82571b20c 100644 --- a/lily/include/my-lily-parser.hh +++ b/lily/include/my-lily-parser.hh @@ -50,7 +50,7 @@ public: bool ignore_version_b_; Input here_input () const; - void remember_spot (); + void push_spot (); Input pop_spot (); void do_yyparse (); diff --git a/lily/my-lily-parser.cc b/lily/my-lily-parser.cc index f6553c9cb5..4a44f5919a 100644 --- a/lily/my-lily-parser.cc +++ b/lily/my-lily-parser.cc @@ -64,7 +64,7 @@ My_lily_parser::parse_file (String init, String s) } void -My_lily_parser::remember_spot () +My_lily_parser::push_spot () { define_spot_array_.push (here_input ()); } diff --git a/lily/parser.yy b/lily/parser.yy index b9f4793d2c..720732e88c 100644 --- a/lily/parser.yy +++ b/lily/parser.yy @@ -409,7 +409,7 @@ lilypond_header: */ assignment: STRING { - THIS->remember_spot (); + THIS->push_spot (); } /* cont */ '=' identifier_init { @@ -535,7 +535,7 @@ translator_spec_body: */ score_block: SCORE { - THIS->remember_spot (); + THIS->push_spot (); } /*cont*/ '{' score_body '}' { THIS->pop_spot (); @@ -856,7 +856,7 @@ Composite_music: $$ = csm; } | TIMES { - THIS->remember_spot (); + THIS->push_spot (); } /* CONTINUED */ fraction Music @@ -1076,18 +1076,19 @@ scalar: request_chord: - pre_requests simple_element post_requests { - Music_sequence *l = dynamic_cast ($2); + pre_requests { + THIS->push_spot (); + } /*cont */ simple_element post_requests { + Music_sequence *l = dynamic_cast ($3); if (l) { for (int i=0; i < $1->size (); i++) l->append_music ($1->elem (i)); - for (int i=0; i < $3->size (); i++) - l->append_music ($3->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"); - $$ = $2; - + $$ = $3; } | command_element ; @@ -1675,6 +1676,8 @@ tremolo_type: simple_element: pitch exclamations questions optional_notemode_duration { + + Input i = THIS->pop_spot (); if (!THIS->lexer_p_->note_state_b ()) THIS->parser_error (_ ("Have to be in Note mode for notes")); @@ -1691,40 +1694,36 @@ simple_element: Simultaneous_music*v = new Request_chord (SCM_EOL); v->set_mus_property ("elements", gh_list (n->self_scm (), SCM_UNDEFINED)); -/* -FIXME: location is one off, since ptich & duration don't contain origin refs. -*/ - v->set_spot (THIS->here_input ()); - n->set_spot (THIS->here_input ()); - + v->set_spot (i); + n->set_spot (i); $$ = v; } | RESTNAME optional_notemode_duration { - SCM e = SCM_UNDEFINED; - if (ly_scm2string ($1) =="s") - { /* Space */ - Skip_req * skip_p = new Skip_req; - skip_p->set_mus_property ("duration" ,$2); - - skip_p->set_spot (THIS->here_input ()); + Input i = THIS->pop_spot (); + SCM e = SCM_UNDEFINED; + if (ly_scm2string ($1) =="s") { + /* Space */ + Skip_req * skip_p = new Skip_req; + skip_p->set_mus_property ("duration" ,$2); + skip_p->set_spot (i); e = skip_p->self_scm (); - } - else - { - Rest_req * rest_req_p = new Rest_req; - rest_req_p->set_mus_property ("duration", $2); - rest_req_p->set_spot (THIS->here_input ()); + } + else { + Rest_req * rest_req_p = new Rest_req; + rest_req_p->set_mus_property ("duration", $2); + rest_req_p->set_spot (i); e = rest_req_p->self_scm (); } - Simultaneous_music* velt_p = new Request_chord (SCM_EOL); + Simultaneous_music* velt_p = new Request_chord (SCM_EOL); velt_p-> set_mus_property ("elements", gh_list (e,SCM_UNDEFINED)); - velt_p->set_spot (THIS->here_input ()); - + velt_p->set_spot (i); - $$ = velt_p; + $$ = velt_p; } | MULTI_MEASURE_REST optional_notemode_duration { + Input = THIS->pop_spot (); + Skip_req * sk = new Skip_req; sk->set_mus_property ("duration", $2); Span_req *sp1 = new Span_req; @@ -1748,19 +1747,20 @@ FIXME: location is one off, since ptich & duration don't contain origin refs. $$->set_mus_property ("elements", ms); } | STRING optional_notemode_duration { + Input = THIS->pop_spot (); Lyric_req* lreq_p = new Lyric_req; lreq_p->set_mus_property ("text", $1); lreq_p->set_mus_property ("duration",$2); - lreq_p->set_spot (THIS->here_input ()); + lreq_p->set_spot (i); Simultaneous_music* velt_p = new Request_chord (SCM_EOL); velt_p->set_mus_property ("elements", gh_list (lreq_p->self_scm (), SCM_UNDEFINED)); - $$= velt_p; - } | chord { + Input = THIS->pop_spot (); + if (!THIS->lexer_p_->chord_state_b ()) THIS->parser_error (_ ("Have to be in Chord mode for chords")); $$ = $1; -- 2.39.5