- 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());
- answer = scm_eval (form, module);
- }
- else
- answer = scm_primitive_eval (form);
+ if (ps->parser_->lexer_->top_input ())
+ {
+ // Find any precompiled form.
+ SCM c = scm_assv_ref (ps->parser_->closures_, from);
+ if (scm_is_true (c))
+ // Replace form with a call to previously compiled closure
+ form = scm_list_1 (c);
+ }
+ if (multiple)
+ form = scm_list_3 (ly_symbol2scm ("apply"),
+ ly_symbol2scm ("values"),
+ form);
+ return form;