From 47be185531a560ceb8478f1192bb2d257aa02c9a Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Sun, 6 Oct 2002 01:13:29 +0000 Subject: [PATCH] * lily/source-file.cc (get_line): oops. All line numbers were off by 2. Fix that. * lily/parser.yy (event_that_take_dir): allow () \< \> \! \( \) to be after the note, combined with -_^, i.e. c4-(-\)-\> * ly/params-init.ly (ledgerlinethickness): use Scheme expressions. * lily/parser.yy (number_factor): remove (number) as number expression. ("Let them eat Lisp"). --- ChangeLog | 13 +++++++++++++ flower/include/array.hh | 2 -- lily/folded-repeat-iterator.cc | 6 +++--- lily/input-file-results.cc | 2 ++ lily/parser.yy | 7 +++---- lily/score.cc | 8 +------- lily/source-file.cc | 14 ++++++++++---- ly/params-init.ly | 8 ++++---- scm/lily.scm | 3 +++ 9 files changed, 39 insertions(+), 24 deletions(-) diff --git a/ChangeLog b/ChangeLog index dd19eebb81..aacd97572c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2002-10-06 Han-Wen Nienhuys + + * lily/source-file.cc (get_line): oops. All line numbers were off + by 2. Fix that. + + * lily/parser.yy (event_that_take_dir): allow () \< \> \! \( \) to + be after the note, combined with -_^, i.e. c4-(-\)-\> + + * ly/params-init.ly (ledgerlinethickness): use Scheme expressions. + + * lily/parser.yy (number_factor): remove (number) as number + expression. ("Let them eat Lisp"). + 2002-10-05 Han-Wen Nienhuys * lily/horizontal-bracket.cc: new file. diff --git a/flower/include/array.hh b/flower/include/array.hh index 209feaa95a..a444e5ebb7 100644 --- a/flower/include/array.hh +++ b/flower/include/array.hh @@ -183,8 +183,6 @@ public: { return (*this)[size_-j-1]; } - - T& boundary (int dir, int idx) { diff --git a/lily/folded-repeat-iterator.cc b/lily/folded-repeat-iterator.cc index 06fefb1f4a..da91f14315 100644 --- a/lily/folded-repeat-iterator.cc +++ b/lily/folded-repeat-iterator.cc @@ -127,9 +127,9 @@ Folded_repeat_iterator::enter_alternative () Repeated_music * mus = dynamic_cast (get_music ()); if (mus->alternatives ()) { - /* - ugh. - */ + /* + ugh. + */ Simultaneous_music_iterator * s = new Simultaneous_music_iterator; s->separate_contexts_b_ = true; s->init_translator (mus, report_to ()); diff --git a/lily/input-file-results.cc b/lily/input-file-results.cc index 1f9362bf48..64113912ae 100644 --- a/lily/input-file-results.cc +++ b/lily/input-file-results.cc @@ -50,6 +50,8 @@ argument is a symbol. Possible options are @code{none} (no source specials), extern SCM lily_module; scm_module_define (lily_module, ly_symbol2scm ("point-and-click"), val); + + store_locations_global_b =gh_procedure_p (val); return SCM_UNSPECIFIED; } diff --git a/lily/parser.yy b/lily/parser.yy index 981c221005..aa03733295 100644 --- a/lily/parser.yy +++ b/lily/parser.yy @@ -1376,6 +1376,8 @@ string_event: event_that_take_dir: gen_text_def | verbose_event + | close_event + | open_event | script_abbreviation { SCM s = THIS->lexer_->lookup_identifier ("dash" + ly_scm2string ($1)); Music *a = MY_MAKE_MUSIC("ArticulationEvent"); @@ -2061,10 +2063,7 @@ number_term: ; number_factor: - '(' number_expression ')' { - $$ = $2; - } - | '-' number_factor { /* %prec UNARY_MINUS */ + '-' number_factor { /* %prec UNARY_MINUS */ $$ = scm_difference ($2, SCM_UNDEFINED); } | bare_number diff --git a/lily/score.cc b/lily/score.cc index ccb5b2b95d..387beeb59b 100644 --- a/lily/score.cc +++ b/lily/score.cc @@ -75,13 +75,7 @@ Score::~Score () void Score::run_translator (Music_output_def *odef) { - /* - We want to know if we want to store locations, since they take a - lot of overhead. - */ - store_locations_global_b = (gh_eval_str ("point-and-click") != SCM_BOOL_F); - - Cpu_timer timer; + Cpu_timer timer; Global_translator * trans = odef->get_global_translator (); if (!trans) { diff --git a/lily/source-file.cc b/lily/source-file.cc index 1ff2f3d6d4..0520502e54 100644 --- a/lily/source-file.cc +++ b/lily/source-file.cc @@ -84,9 +84,6 @@ Source_file::Source_file (String filename, String data) init_port(); } - - - Source_file::Source_file (String filename_string) { name_string_ = filename_string; @@ -262,15 +259,24 @@ Source_file::get_line (char const* pos_str0) const if (!in_b (pos_str0)) return 0; + if (!newline_locations_.size()) + return 1; + int lo=0; int hi = newline_locations_.size(); + + if (newline_locations_[lo] > pos_str0) + return 1; + + if (newline_locations_[hi-1] < pos_str0) + return hi; binary_search_bounds (newline_locations_, pos_str0, Link_array::default_compare, &lo, &hi); - return lo; + return lo + 2; } int diff --git a/ly/params-init.ly b/ly/params-init.ly index c17d26748f..f35faf4ef4 100644 --- a/ly/params-init.ly +++ b/ly/params-init.ly @@ -19,10 +19,10 @@ paperfile = \papersize + "-init.ly" \include "paper-init.ly" unit = "mm" -staffspace = \staffheight / 4.0 -linethickness = \staffspace / 10.0 -outputscale = \staffheight / 4.0 -ledgerlinethickness = 2.0 * \linethickness +staffspace = #(/ staffheight 4.0) +linethickness = #(/ staffspace 10.0) +outputscale = #(/ staffheight 4.0) +ledgerlinethickness = #(* 2.0 linethickness) diff --git a/scm/lily.scm b/scm/lily.scm index eace878d5c..fd14d4a4d5 100644 --- a/scm/lily.scm +++ b/scm/lily.scm @@ -31,11 +31,14 @@ (string-append (number->string line) " " file) ) +(define-public point-and-click #f) + ;; cpp hack to get useful error message (define ifdef "First run this through cpp.") (define ifndef "First run this through cpp.") + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define-public X 0) -- 2.39.2