"expect-error" = ##t
-#(ly:lexer-set-safe! (ly:parser-lexer parser))
+% Ugh - this affects other files too.
+#(ly:set-option 'protected-scheme-parsing #t)
+#(ly:set-option 'safe #t)
"force-finish" = ##t
be_verbose_global = true;
break;
case 's':
- be_safe_global = true;
init_scheme_variables
+= "(cons \'safe #t)\n";
parsed_objects_should_be_dead = to_boolean (val);
val = scm_from_bool (parsed_objects_should_be_dead);
}
+ else if (var == ly_symbol2scm ("safe"))
+ {
+ be_safe_global = to_boolean (val);
+ val = scm_from_bool (be_safe_global);
+ }
else if (var == ly_symbol2scm ("old-relative"))
{
lily_1_8_relative = to_boolean (val);
+LY_DEFINE (ly_all_option, "ly:all-options",
+ 0, 0, 0, (),
+ "Get all option settings in an alist.")
+{
+ return ly_hash2alist (option_hash);
+}
+
LY_DEFINE (ly_get_option, "ly:get-option", 1, 0, 0, (SCM var),
"Get a global option setting.")
}
+
bool
get_program_option (const char *s)
{
#(define $defaultheader #f)
#(define version-seen #f)
#(define expect-error #f)
-
+
#(use-modules (scm clip-region))
\maininput
%% there is a problem at the end of the input file
(let* ((failed '())
(separate-logs (ly:get-option 'separate-log-files))
- (start-measurements (ly:get-option 'dump-profile))
+ (do-measurements (ly:get-option 'dump-profile))
(handler (lambda (key failed-file)
(set! failed (append (list failed-file) failed)))))
(for-each
(lambda (x)
-
- (gc)
- (if start-measurements
- (set! start-measurements (profile-measurements)))
-
- (if separate-logs
- (ly:stderr-redirect (format "~a.log" (basename x ".ly")) "w"))
+ (let*
+ ((start-measurements (if do-measurements
+ (begin
+ (gc)
+ (profile-measurements))
+ #f))
+ (base (basename x ".ly"))
+ (all-settings (ly:all-options)))
+
+ (if separate-logs
+ (ly:stderr-redirect (format "~a.log" base) "w"))
- (lilypond-file handler x)
- (if start-measurements
- (dump-profile x start-measurements (profile-measurements)))
+ (lilypond-file handler x)
+ (if start-measurements
+ (dump-profile x start-measurements (profile-measurements)))
-
- (ly:clear-anonymous-modules)
- (if (ly:get-option 'debug-gc)
- (dump-gc-protects)
- (if (= (random 40) 1)
- (ly:reset-all-fonts))))
+ (for-each
+ (lambda (s)
+ (ly:set-option (car s) (cdr s)))
+ all-settings)
+
+ (ly:clear-anonymous-modules)
+ (if (ly:get-option 'debug-gc)
+ (dump-gc-protects)
+ (if (= (random 40) 1)
+ (ly:reset-all-fonts)))))
files)