+ if (!SCM_EOF_OBJECT_P (form)) {
+ if (ps->parser_->lexer_->top_input ()
+ && scm_is_pair (ps->parser_->local_environment_)) {
+ form = scm_list_1 (scm_car (ps->parser_->local_environment_));
+ ps->parser_->local_environment_ = scm_cdr (ps->parser_->local_environment_);
+ }
+ return scm_cons (form, make_input (ps->start_location_));
+ }
+
+ return SCM_UNDEFINED;
+}
+
+SCM
+internal_ly_eval_scm (Parse_start *ps)
+{
+ if (ps->safe_)
+ {
+ 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);
+ }
+
+ // We define the parser so trusted Scheme functions can
+ // access the real namespace underlying the parser.
+ if (ps->parser_)
+ scm_module_define (module, ly_symbol2scm ("parser"),
+ ps->parser_->self_scm ());
+ return scm_eval (ps->form_, module);
+ }
+ return scm_primitive_eval (ps->form_);