Skip to content

Commit

Permalink
Merge commit '3a5078fde80ae6304c05bbf7322c9626d58c40c9'
Browse files Browse the repository at this point in the history
  • Loading branch information
xen-git committed Aug 9, 2011
2 parents 69ad9d1 + 3a5078f commit 2f52beb
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions ocaml/doc/odoc_json.ml
Expand Up @@ -75,20 +75,20 @@ open String
let remove_asterisks str =
let n = String.length str in
let res = Buffer.create n in
let phase = ref 0 in
let phase = ref false in
for i = 0 to n-1 do
match !phase with
| 0 ->
| false ->
if str.[i] == '\n' then begin
phase := 1;
phase := true;
Buffer.add_char res ' '
end else if i == 0 && str.[i] == '*' then
phase := 1
phase := true
else
Buffer.add_char res str.[i]
| 1 ->
| true ->
if not (List.mem str.[i] ['\n'; '\t'; ' '; '*']) then begin
phase := 0;
phase := false;
Buffer.add_char res str.[i]
end
| _ -> failwith "something went wrong!"
Expand Down Expand Up @@ -166,7 +166,7 @@ let rec json_to_string n = function
| Object l -> (endl n) ^ "{ " ^ (String.concat ("," ^ (endl (n+1))) (List.map (fun (s, j) -> "\"" ^ s ^ "\": " ^ (json_to_string (n+2) j)) l)) ^ " }"
| Array l -> "[ " ^ (String.concat ", " (List.map (fun j -> (json_to_string n j)) l)) ^ " ]"
| String s -> "\"" ^ (escape_json s) ^ "\""
| Number n -> string_of_float n
| Number n -> Printf.sprintf "%.4f" n
| True -> "true"
| False -> "false"
| Empty -> "\"\""
Expand Down

0 comments on commit 2f52beb

Please sign in to comment.