]> git.donarmstrong.com Git - lilypond.git/commitdiff
(ly_parse_scm): add line/col/file
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Mon, 29 Jul 2002 13:22:48 +0000 (13:22 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Mon, 29 Jul 2002 13:22:48 +0000 (13:22 +0000)
locations SCM  port for parser.

ChangeLog
lily/include/lily-guile.hh
lily/lexer.ll
lily/lily-guile.cc
lily/main.cc

index acde777abfedc03085287ef635168eac85a7249e..2c27e9ef55430d28c26cb87cb34cdb1d4fcc74f2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2002-07-29  Han-Wen Nienhuys  <hanwen@cs.uu.nl>
+
+       * lily/lily-guile.cc (ly_parse_scm): add line/col/file
+       locations SCM  port for parser.
+
 2002-07-28  Rune Zedeler <rune@zedeler.dk>
        
        * lily/note-spacing.cc (stem_dir_correction) Add property
index a14f2be4aa3cab312dd50730ec3b090ad9b32efe..e6286958601205ef37e975f2af5797e557083d3e 100644 (file)
@@ -156,8 +156,8 @@ Interval ly_scm2interval (SCM);
 Slice int_list_to_slice (SCM l);
 SCM ly_interval2scm (Drul_array<Real>);
 
-
-SCM ly_parse_scm (char const* s, int* n);
+struct Input;
+SCM ly_parse_scm (char const* s, int *, Input);
 SCM ly_quote_scm (SCM s);
 SCM ly_type (SCM);
 bool type_check_assignment (SCM val, SCM sym,  SCM type_symbol) ;
index 295613c172980412e4fa485f6d28070d68de8a53..f6b0a40a4ad2c8a14043dff8a0a5517bc113fbae 100644 (file)
@@ -258,7 +258,7 @@ HYPHEN              --
                yylval.scm =  SCM_EOL;
                return SCM_T;
        }
-       yylval.scm = ly_parse_scm (s, &n);
+       yylval.scm = ly_parse_scm (s, &n, here_input());
        
        for (int i=0; i < n; i++)
        {
index 53028fb9265adf968b3a4910b11d44645631fffc..7f4ceb80b086e67eeb5814b0fb53a28ac8bcf600 100644 (file)
@@ -88,12 +88,20 @@ ly_write2scm (SCM s)
 
   Need guile-1.3.4 (>1.3 anyway) for ftell on str ports -- jcn
 */
+/*
+  should move this func elsewhere (?)
+ */
 SCM
-ly_parse_scm (char const* s, int* n)
+ly_parse_scm (char const* s, int* n, Input ip)
 {
   SCM str = ly_str02scm (s);
   SCM port = scm_mkstrport (SCM_INUM0, str, SCM_OPN | SCM_RDNG,
                             "ly_eval_scm_0str");
+
+  scm_set_port_filename_x (port, scm_makfrom0str (ip.file_string ().str0()));
+  scm_set_port_line_x (port,  gh_int2scm (ip.line_number ()));
+  scm_set_port_column_x (port,  gh_int2scm (ip.column_number()));
+  
   SCM from = scm_ftell (port);
 
   SCM form;
index c6a45e4e67672b7936830e16b632977dc413bc49..2ef9af2f5a4f195604f70c7159f673081cd245b4 100644 (file)
@@ -338,7 +338,8 @@ main_prog (void *, int, char **)
       /* Junk this.  We should make real modules iso. just loading files. */
       prepend_load_path (String (prefix_directory[i]) + "/scm");
     }
-      
+
+  SCM_RECORD_POSITIONS_P = 1; 
   if (verbose_global_b)
     dirinfo (stderr);