1 let r_dash = Str.regexp
" - ";;
3 let dashpos = try Str.search_forward
r_dash s
0 with Not_found
-> -1 in
6 let l = String.length s
in
7 if l > 11 && String.sub s
0 5 = "-----"
9 "\xc2\xb7" ^
String.sub s
5 (l - 10)
13 let rec findnonwsback i
=
16 then findnonwsback (i
-1)
19 let nonwspos = findnonwsback dashpos in
20 let b = Buffer.create
80 in
21 Buffer.add_substring
b s
0 (nonwspos+1);
22 Buffer.add_char
b '
\t'
;
23 Buffer.add_substring
b s
(dashpos+1) (String.length s
- dashpos - 1);
29 match input_line stdin
with
30 | line
-> fold (tabify line
:: accu
)
31 | exception End_of_file
-> List.rev accu
37 print_endline
"let keys = [";
38 List.iter
(Printf.printf
" %S;\n") lines;