156 |
(match option_name with |
(match option_name with |
157 |
[] -> "???" |
[] -> "???" |
158 |
| name :: _ -> name); |
| name :: _ -> name); |
159 |
lprintf "%s" (Printexc2.to_string e); |
lprintf_nl "%s" (Printexc2.to_string e); |
|
lprint_newline (); |
|
160 |
default_value |
default_value |
161 |
end; |
end; |
162 |
o |
o |
298 |
let list = |
let list = |
299 |
try parse_gwmlrc stream with |
try parse_gwmlrc stream with |
300 |
e -> |
e -> |
301 |
lprintf "At pos %d/%d" (Stream.count s) (Stream.count stream); |
lprintf_nl "At pos %d/%d" (Stream.count s) (Stream.count stream); |
|
lprint_newline (); |
|
302 |
raise e |
raise e |
303 |
in |
in |
304 |
List.iter |
List.iter |
310 |
exec_hooks o |
exec_hooks o |
311 |
with |
with |
312 |
e -> |
e -> |
313 |
lprintf "Exc %s" (Printexc2.to_string e); lprint_newline ()) |
lprintf_nl "Exc %s" (Printexc2.to_string e)) |
314 |
options; |
options; |
315 |
list |
list |
316 |
with |
with |
317 |
e -> |
e -> |
318 |
lprintf "Error %s in %s" (Printexc2.to_string e) filename; |
lprintf_nl "Error %s in %s" (Printexc2.to_string e) filename; |
|
lprint_newline (); |
|
319 |
[] |
[] |
320 |
;; |
;; |
321 |
|
|
322 |
let load opfile = |
let load opfile = |
323 |
try opfile.file_rc <- really_load opfile.file_name opfile.file_options with |
try opfile.file_rc <- really_load opfile.file_name opfile.file_options with |
324 |
Not_found -> |
Not_found -> |
325 |
lprintf "No %s found" opfile.file_name; lprint_newline () |
lprintf_nl "No %s found" opfile.file_name |
326 |
;; |
;; |
327 |
|
|
328 |
let append opfile filename = |
let append opfile filename = |
329 |
try opfile.file_rc <- |
try opfile.file_rc <- |
330 |
really_load filename opfile.file_options @ opfile.file_rc with |
really_load filename opfile.file_options @ opfile.file_rc with |
331 |
Not_found -> |
Not_found -> |
332 |
lprintf "No %s found" filename; lprint_newline () |
lprintf_nl "No %s found" filename |
333 |
;; |
;; |
334 |
|
|
335 |
let ( !! ) o = o.option_value;; |
let ( !! ) o = o.option_value;; |
569 |
o.option_class.to_value o.option_value |
o.option_class.to_value o.option_value |
570 |
with |
with |
571 |
e -> |
e -> |
572 |
lprintf "Error while saving option \"%s\": %s" |
lprintf_nl "Error while saving option \"%s\": %s" |
573 |
(try List.hd o.option_name with |
(try List.hd o.option_name with |
574 |
_ -> "???") |
_ -> "???") |
575 |
(Printexc2.to_string e); |
(Printexc2.to_string e); |
|
lprint_newline (); |
|
576 |
StringValue "")) |
StringValue "")) |
577 |
(List.rev opfile.file_options)); |
(List.rev opfile.file_options)); |
578 |
if not opfile.file_pruned then begin |
if not opfile.file_pruned then begin |
652 |
List [v1; v2] -> from_value c1 v1, from_value c2 v2 |
List [v1; v2] -> from_value c1 v1, from_value c2 v2 |
653 |
| SmallList [v1; v2] -> from_value c1 v1, from_value c2 v2 |
| SmallList [v1; v2] -> from_value c1 v1, from_value c2 v2 |
654 |
| List l | SmallList l -> |
| List l | SmallList l -> |
655 |
lprintf "list of %d" (List.length l); |
lprintf_nl "list of %d" (List.length l); |
|
lprint_newline (); |
|
656 |
failwith "Options: not a tuple2 list option" |
failwith "Options: not a tuple2 list option" |
657 |
| _ -> failwith "Options: not a tuple2 option" |
| _ -> failwith "Options: not a tuple2 option" |
658 |
;; |
;; |