Skip to content
Snippets Groups Projects
Commit 24ad78d3 authored by Loïc Correnson's avatar Loïc Correnson
Browse files

[server] remove Transitioning for String and Char

parent 67f959c0
No related branches found
No related tags found
No related merge requests found
...@@ -121,7 +121,7 @@ type href = [ ...@@ -121,7 +121,7 @@ type href = [
| `Section of string * string | `Section of string * string
] ]
let filepath m = Transitioning.String.split_on_char '/' m let filepath m = String.split_on_char '/' m
let rec relative source target = let rec relative source target =
match source , target with match source , target with
...@@ -134,7 +134,7 @@ let lnk target = ...@@ -134,7 +134,7 @@ let lnk target =
let id m = let id m =
let buffer = Buffer.create (String.length m) in let buffer = Buffer.create (String.length m) in
let lowercase = Transitioning.Char.lowercase_ascii in let lowercase = Char.lowercase_ascii in
let dash = ref false in let dash = ref false in
let emit c = let emit c =
if !dash then (Buffer.add_char buffer '-' ; dash := false) ; if !dash then (Buffer.add_char buffer '-' ; dash := false) ;
...@@ -220,7 +220,7 @@ let code ?(lang="") pp fmt = ...@@ -220,7 +220,7 @@ let code ?(lang="") pp fmt =
let bfmt = Format.formatter_of_buffer buffer in let bfmt = Format.formatter_of_buffer buffer in
pp bfmt ; Format.pp_print_flush bfmt () ; pp bfmt ; Format.pp_print_flush bfmt () ;
let content = Buffer.contents buffer in let content = Buffer.contents buffer in
let lines = Transitioning.String.split_on_char '\n' content in let lines = String.split_on_char '\n' content in
let rec clean = function [] -> [] | ""::w -> clean w | w -> w in let rec clean = function [] -> [] | ""::w -> clean w | w -> w in
List.iter List.iter
(fun l -> Format.fprintf fmt "@\n%s" l) (fun l -> Format.fprintf fmt "@\n%s" l)
......
...@@ -97,7 +97,7 @@ let _ = page `Protocol ~title:"Architecture" ~filename:"server.md" ...@@ -97,7 +97,7 @@ let _ = page `Protocol ~title:"Architecture" ~filename:"server.md"
let title_of_chapter = function let title_of_chapter = function
| `Protocol -> "Server Protocols" | `Protocol -> "Server Protocols"
| `Kernel -> "Kernel Services" | `Kernel -> "Kernel Services"
| `Plugin name -> "Plugin " ^ Transitioning.String.capitalize_ascii name | `Plugin name -> "Plugin " ^ String.capitalize_ascii name
let pages_of_chapter c = let pages_of_chapter c =
let w = ref [] in let w = ref [] in
......
...@@ -51,8 +51,6 @@ type 'a output = (module Output with type t = 'a) ...@@ -51,8 +51,6 @@ type 'a output = (module Output with type t = 'a)
(* --- Sanity Checks --- *) (* --- Sanity Checks --- *)
(* -------------------------------------------------------------------------- *) (* -------------------------------------------------------------------------- *)
module STR = Transitioning.String
let re_set = Str.regexp_string_case_fold "SET" let re_set = Str.regexp_string_case_fold "SET"
let re_get = Str.regexp_case_fold "\\(GET\\|PRINT\\)" let re_get = Str.regexp_case_fold "\\(GET\\|PRINT\\)"
let re_exec = Str.regexp_case_fold "\\(EXEC\\|COMPUTE\\)" let re_exec = Str.regexp_case_fold "\\(EXEC\\|COMPUTE\\)"
...@@ -67,8 +65,8 @@ let check_name name = ...@@ -67,8 +65,8 @@ let check_name name =
"Request %S is not a dot-separated list of (camlCased) identifiers" name "Request %S is not a dot-separated list of (camlCased) identifiers" name
let check_plugin plugin name = let check_plugin plugin name =
let p = STR.lowercase_ascii plugin in let p = String.lowercase_ascii plugin in
let n = STR.lowercase_ascii name in let n = String.lowercase_ascii name in
let k = String.length plugin in let k = String.length plugin in
if not (String.length name > k && if not (String.length name > k &&
String.sub n 0 k = p && String.sub n 0 k = p &&
...@@ -76,7 +74,7 @@ let check_plugin plugin name = ...@@ -76,7 +74,7 @@ let check_plugin plugin name =
then then
Senv.warning ~wkey:wpage Senv.warning ~wkey:wpage
"Request '%s' shall be named « %s.* »" "Request '%s' shall be named « %s.* »"
name (STR.capitalize_ascii plugin) name (String.capitalize_ascii plugin)
let check_page page name = let check_page page name =
match Doc.chapter page with match Doc.chapter page with
......
...@@ -22,12 +22,11 @@ ...@@ -22,12 +22,11 @@
(* -------------------------------------------------------------------------- *) (* -------------------------------------------------------------------------- *)
module STR = Transitioning.String
module Senv = Server_parameters module Senv = Server_parameters
let check_plugin plugin name = let check_plugin plugin name =
let p = STR.lowercase_ascii plugin in let p = String.lowercase_ascii plugin in
let n = STR.lowercase_ascii name in let n = String.lowercase_ascii name in
let k = String.length plugin in let k = String.length plugin in
if not (String.length name > k && if not (String.length name > k &&
String.sub n 0 k = p && String.sub n 0 k = p &&
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment