]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/parse-scm.cc
* lily/music.cc (derived_mark): derive Music from Prob.
[lilypond.git] / lily / parse-scm.cc
index b5dee5edf029288a7d239891957173effef443b1..4aee3942903de7959dbb7dc5800deb99180780d6 100644 (file)
@@ -3,12 +3,13 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c) 2004--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  (c) 2004--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
 */
 
 #include "parse-scm.hh"
 
 #include <cstdio>
+using namespace std;
 
 #include "main.hh"
 #include "paper-book.hh"
 SCM
 internal_ly_parse_scm (Parse_start *ps)
 {
-  Source_file *sf = ps->start_location_.source_file_;
+  Source_file *sf = ps->start_location_.get_source_file ();
   SCM port = sf->get_port ();
 
-  int off = ps->start_location_.start_ - sf->to_str0 ();
+  int off = ps->start_location_.start () - sf->c_str ();
 
   scm_seek (port, scm_long2num (off), scm_long2num (SEEK_SET));
   SCM from = scm_ftell (port);
 
-  SCM form;
   SCM answer = SCM_UNSPECIFIED;
+  SCM form = scm_read (port);
 
   /* Read expression from port.  */
-  if (!SCM_EOF_OBJECT_P (form = scm_read (port)))
+  if (!SCM_EOF_OBJECT_P (form))
     {
       if (ps->safe_)
        {
@@ -46,9 +47,7 @@ internal_ly_parse_scm (Parse_start *ps)
          answer = scm_eval (form, module);
        }
       else
-       {
-         answer = scm_primitive_eval (form);
-       }
+       answer = scm_primitive_eval (form);
     }
 
   /* Reset read_buf for scm_ftell.