(c) 2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
+#include "parse-scm.hh"
-#include <stdio.h>
+#include <cstdio>
#include "ly-module.hh"
-#include "lily-guile.hh"
#include "main.hh"
#include "paper-book.hh"
-#include "parse-scm.hh"
-#include "string.hh"
#include "source-file.hh"
/* Pass string to scm parser, evaluate one expression.
SCM
internal_ly_parse_scm (Parse_start * ps)
{
- Source_file *sf =ps->start_location_.source_file_;
+ Source_file *sf = ps->start_location_.source_file_;
SCM port = sf->get_port ();
int off = ps->start_location_.defined_str0_ - sf->to_str0 ();
/* Read expression from port. */
if (!SCM_EOF_OBJECT_P (form = scm_read (port)))
{
- SCM function = ly_scheme_function ("make-safe-lilypond-module");
if (ps->safe_)
- answer = scm_eval (form, function);
+ {
+ static SCM module = SCM_BOOL_F;
+ if (module == SCM_BOOL_F)
+ {
+ SCM function = ly_lily_module_constant ("make-safe-lilypond-module");
+ module = scm_call_0 (function);
+ }
+ answer = scm_eval (form, module);
+ }
else
answer = scm_primitive_eval (form);
}
ps->start_location_.error (_("GUILE signaled an error for the expression beginning here"));
if (scm_ilength (args) > 2)
- scm_display_error_message (ly_cadr (args), ly_caddr (args), scm_current_error_port ());
+ scm_display_error_message (scm_cadr (args), scm_caddr (args), scm_current_error_port ());
/*
The following is a kludge; we should probably search for