From 17912cfaa97a8c3159026435db295c055a977270 Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Tue, 18 Jun 2002 14:36:05 +0000 Subject: [PATCH] (open_request_parens): add input locations to open and close parens. --- ChangeLog | 5 +++++ lily/include/duration.hh | 13 ++++++++----- lily/musical-request.cc | 12 +++++++----- lily/parser.yy | 8 ++++++++ 4 files changed, 28 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index ab0f437ee5..dce7808ecb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2002-06-18 Han-Wen Nienhuys + + * lily/parser.yy (open_request_parens): add input locations to + open and close parens. + 2002-06-17 Chris Jackson * lily/tuplet-bracket.cc: diff --git a/lily/include/duration.hh b/lily/include/duration.hh index c256f74d85..49fe93e243 100644 --- a/lily/include/duration.hh +++ b/lily/include/duration.hh @@ -18,21 +18,24 @@ A musical duration. */ struct Duration { +public: + Duration (); Duration (int, int); String str () const; - void set_plet (int,int ); + Duration compressed (Rational) const; Rational length_mom () const ; + + + int duration_log ()const; + int dot_count () const; + static int compare (Duration const&, Duration const&); SCM smobbed_copy () const; DECLARE_SCHEME_CALLBACK (less_p, (SCM a, SCM b)); DECLARE_SIMPLE_SMOBS (Duration,); - -public: - int duration_log ()const; - int dot_count () const; private: /// Logarithm of the base duration. diff --git a/lily/musical-request.cc b/lily/musical-request.cc index 147fce3fa2..28aee7f944 100644 --- a/lily/musical-request.cc +++ b/lily/musical-request.cc @@ -35,11 +35,13 @@ Moment Rhythmic_req::length_mom () const { Duration *d = unsmob_duration (get_mus_property ("duration")); - if (!d){ - Moment m ; - programming_error("Rhythmic_req has no duration"); - return m; - } + if (!d) + { + Moment m ; + programming_error("Rhythmic_req has no duration"); + return m; + } + return d->length_mom (); } diff --git a/lily/parser.yy b/lily/parser.yy index 05d570ab5b..5a27a77dfe 100644 --- a/lily/parser.yy +++ b/lily/parser.yy @@ -1535,21 +1535,25 @@ close_request_parens: Span_req* s= new Span_req; $$ = s; s->set_mus_property ("span-type", ly_str02scm ( "slur")); + s->set_spot (THIS->here_input()); } | E_OPEN { Span_req* s= new Span_req; $$ = s; s->set_mus_property ("span-type", ly_str02scm ( "phrasing-slur")); + s->set_spot (THIS->here_input()); } | E_SMALLER { Span_req*s =new Span_req; $$ = s; s->set_mus_property ("span-type", ly_str02scm ( "crescendo")); + s->set_spot (THIS->here_input()); } | E_BIGGER { Span_req*s =new Span_req; $$ = s; s->set_mus_property ("span-type", ly_str02scm ("decrescendo")); + s->set_spot (THIS->here_input()); } ; @@ -1565,6 +1569,7 @@ open_request_parens: E_EXCLAMATION { Span_req *s = new Span_req; s->set_mus_property ("span-type", ly_str02scm ( "crescendo")); + s->set_spot (THIS->here_input()); $$ = s; } @@ -1572,11 +1577,14 @@ open_request_parens: Span_req* s= new Span_req; $$ = s; s->set_mus_property ("span-type", ly_str02scm ( "slur")); + s->set_spot (THIS->here_input()); + } | E_CLOSE { Span_req* s= new Span_req; $$ = s; s->set_mus_property ("span-type", ly_str02scm ( "phrasing-slur")); + s->set_spot (THIS->here_input()); } ; -- 2.39.2