Commit dd7215a0 authored by François Bobot's avatar François Bobot
Browse files

Ident : Everything can be sanitized

parent 1d3d6e6e
...@@ -148,7 +148,7 @@ let forget_all printer = ...@@ -148,7 +148,7 @@ let forget_all printer =
(** Sanitizers *) (** Sanitizers *)
exception Unsanitizable let unsanitizable = Debug.register_flag "unsanitizable"
let char_to_alpha c = match c with let char_to_alpha c = match c with
| 'a'..'z' | 'A'..'Z' -> String.make 1 c | 'a'..'z' | 'A'..'Z' -> String.make 1 c
...@@ -166,7 +166,10 @@ let char_to_alpha c = match c with ...@@ -166,7 +166,10 @@ let char_to_alpha c = match c with
| '0' -> "zr" | '1' -> "un" | '2' -> "du" | '0' -> "zr" | '1' -> "un" | '2' -> "du"
| '3' -> "tr" | '4' -> "qr" | '5' -> "qn" | '3' -> "tr" | '4' -> "qr" | '5' -> "qn"
| '6' -> "sx" | '7' -> "st" | '8' -> "oc" | '6' -> "sx" | '7' -> "st" | '8' -> "oc"
| '9' -> "nn" | _ -> raise Unsanitizable | '9' -> "nn" | '\n' -> "br"
| _ ->
Debug.dprintf unsanitizable "Unsanitizable : '%c' can't be sanitized@." c;
"zz"
let char_to_lalpha c = String.uncapitalize (char_to_alpha c) let char_to_lalpha c = String.uncapitalize (char_to_alpha c)
let char_to_ualpha c = String.capitalize (char_to_alpha c) let char_to_ualpha c = String.capitalize (char_to_alpha c)
...@@ -185,4 +188,3 @@ let sanitizer head rest n = ...@@ -185,4 +188,3 @@ let sanitizer head rest n =
let rst = List.tl (List.rev !lst) in let rst = List.tl (List.rev !lst) in
let cs = head (String.get n 0) :: rst in let cs = head (String.get n 0) :: rst in
String.concat "" cs String.concat "" cs
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment