open Expr open Func let doc f = f.doc let var s = let buf = Buffer.create (String.length s) in for i = 0 to (String.length s) - 1 do match s.[i] with | '\\' | ' ' | '^' -> () | x -> Buffer.add_char buf x done; Buffer.contents buf let variables f = List.map (fun (_,v) -> Variable.name v, Variable.doc v, Mathset.to_string (Variable.set v), Variable.prop v ) f.variables let documentation f = [ doc f; ""; ]@ List.map (fun (name, doc, set, prop) -> let setprop = if prop <> "" then set ^ ", " ^ prop else set in Printf.sprintf "- %s: %s (%s)" name doc setprop ) (variables f);