8 i: int; (* indentation *)
9 out: string -> unit; (* output function *)
13 i = 0; out = print_string
19 let add st = {st with i = st.i + 3}
21 let sub st = {st with i = st.i - 3}
29 P.sprintf "(%u, %u); (%u+%u, %u+%u); %s"
30 ts.T.y ts.T.x ts.T.rf ts.T.ri ts.T.cf ts.T.ci (parent ts.T.p)
33 let str = S.make 4 ' ' in
34 if tb.T.w then str.[0] <- 'W';
35 if tb.T.n then str.[1] <- 'N';
36 if tb.T.e then str.[2] <- 'E';
37 if tb.T.s then str.[3] <- 'S';
41 P.sprintf "\"%s\"" (S.concat " " tc)
44 | T.Text s -> P.sprintf "\"%s\"" s
46 | T.Glue (Some i) -> P.sprintf "%u" i
52 (****************************************************************************)
56 P.sprintf "%s[{#%u: %s; %s; %s}\n"
57 (indent st) t.T.ti (size t.T.ts) (border t.T.tb) (css t.T.tc)
61 let close_table st t =
63 let str = P.sprintf "%s]\n" (indent st) in
67 let str = P.sprintf "%s%s\n" (indent st) (key k) in
71 let str = P.sprintf "%s%s\n" (indent st) (entry b) in
74 let close_line b st = st
76 let open_entry b st = st
78 let close_entry b st sst = st
81 F.open_table = open_table; F.close_table = close_table;
82 F.open_line = open_line; F.close_line = close_line;
83 F.open_entry = open_entry; F.close_entry = close_entry;
88 let _ = F.fold_table cb home t in ()