]> git.donarmstrong.com Git - lilypond.git/commitdiff
* lily/source-file.cc (get_line): oops. All line numbers were off
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Sun, 6 Oct 2002 01:13:29 +0000 (01:13 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Sun, 6 Oct 2002 01:13:29 +0000 (01:13 +0000)
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
flower/include/array.hh
lily/folded-repeat-iterator.cc
lily/input-file-results.cc
lily/parser.yy
lily/score.cc
lily/source-file.cc
ly/params-init.ly
scm/lily.scm

index dd19eebb814026cc294c8bba5e1ca2b1d8503e1c..aacd97572c6cac551f9ca371986e1c48bca473ef 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2002-10-06  Han-Wen Nienhuys  <hanwen@cs.uu.nl>
+
+       * 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  <hanwen@cs.uu.nl>
 
        * lily/horizontal-bracket.cc: new file.
index 209feaa95a4e079d36b4e44c3b2332bd698b4eef..a444e5ebb7b99153137372a7cf17658ffbe196dd 100644 (file)
@@ -183,8 +183,6 @@ public:
     {
       return (*this)[size_-j-1];
     }
-
-
   
   T& boundary (int dir, int idx)
     {
index 06fefb1f4a80b8948a1e30c2c9e6cc8f5540b4fa..da91f1431508fb3caf6727fc633ef4284c77b34a 100644 (file)
@@ -127,9 +127,9 @@ Folded_repeat_iterator::enter_alternative ()
   Repeated_music *  mus = dynamic_cast<Repeated_music *> (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 ());
index 1f9362bf480440359df470c5d588dba004146c6f..64113912ae70ca5750c3584308dd3e6195090cdd 100644 (file)
@@ -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;
 }
 
index 981c22100590ebe7a3aae17bd0a0761a74902df1..aa0373329564df34ad42142079fdd469c3caaedc 100644 (file)
@@ -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
index ccb5b2b95dd85329a9f25126cee2e222af9e2db9..387beeb59b323a454f08d1eab7aa6103592cc584 100644 (file)
@@ -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)
     {
index 1ff2f3d6d4965d819e3be6f3953363b62fb39350..0520502e540ca4dff1a6f0fefff1261fda6986c8 100644 (file)
@@ -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<char>::default_compare,
                        &lo, &hi);
   
-  return lo;
+  return lo + 2;
 }
 
 int
index c17d26748f4e84564ad69fbba4d9ada38d91e2e6..f35faf4ef466ba78404c2307151c3027c1e706fe 100644 (file)
@@ -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)
 
 
 
index eace878d5cc2d42de765eaeb1bf24197982a335a..fd14d4a4d56bb00fa78f13f127abb03fc72cde6b 100644 (file)
   (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)