]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/parse-scm.cc
(stop_translation_timestep):
[lilypond.git] / lily / parse-scm.cc
index 694872a335c4ec2af6ae18c9b8e9a81f3efb2726..3204dec58a3216116ec4d4cf2648272eeff6383d 100644 (file)
@@ -76,7 +76,7 @@ parse_handler (void * data, SCM tag, SCM args)
 {
   Parse_start* ps = (Parse_start*) data;
 
-  ps->start_location_.error (_("GUILE signaled an error for the expression begining here"));
+  ps->start_location_.error (_("GUILE signaled an error for the expression beginning here"));
 
   if (scm_ilength (args) > 2)
     scm_display_error_message (gh_cadr (args), gh_caddr(args), scm_current_error_port());
@@ -87,7 +87,7 @@ parse_handler (void * data, SCM tag, SCM args)
    */
   ps->nchars = 1;
     
-  return SCM_EOL;
+  return SCM_UNDEFINED;
 }
 
 /*
@@ -109,20 +109,13 @@ protected_ly_parse_scm (Parse_start *ps)
                             &catch_protected_parse_body,
                             (void*)ps,
                             &parse_handler, (void*)ps);
-
 }
 
+bool  parse_protect_global  = true; 
 
-static bool protect = true;
-
-LY_DEFINE(set_parse_protect, "ly-set-parse-protect",
-         1,0,0, (SCM t),
-         "If protection is switched on, errors in inline scheme are caught.")
-{
-  protect =  (t == SCM_BOOL_T);
-  return SCM_UNSPECIFIED;
-}
-
+/*
+  Try parsing. If failure, then return SCM_UNDEFINED.
+ */
 SCM
 ly_parse_scm (char const* s, int *n, Input i)
 {
@@ -131,9 +124,10 @@ ly_parse_scm (char const* s, int *n, Input i)
   ps.str = s;
   ps.start_location_ = i;
 
-  SCM ans = protect ? protected_ly_parse_scm (&ps)
+  SCM ans = parse_protect_global ? protected_ly_parse_scm (&ps)
     : internal_ly_parse_scm (&ps);
   *n = ps.nchars;
+
   return ans;  
 }