locations SCM port for parser.
+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
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) ;
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++)
{
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;
/* 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);