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

Merge branch 'fix/server/naming-rules' into 'stable/calcium'

[server] Fixes server naming rules

See merge request frama-c/frama-c!2457
parents ef5b7da1 53d43676
No related branches found
No related tags found
No related merge requests found
...@@ -51,10 +51,7 @@ type 'a output = (module Output with type t = 'a) ...@@ -51,10 +51,7 @@ type 'a output = (module Output with type t = 'a)
(* --- Sanity Checks --- *) (* --- Sanity Checks --- *)
(* -------------------------------------------------------------------------- *) (* -------------------------------------------------------------------------- *)
let re_set = Str.regexp_string_case_fold "SET" let re_name = Str.regexp_case_fold "[a-zA-Z0-9._]+$"
let re_get = Str.regexp_case_fold "\\(GET\\|PRINT\\)"
let re_exec = Str.regexp_case_fold "\\(EXEC\\|COMPUTE\\)"
let re_name = Str.regexp_case_fold "[a-zA-Z0-9.]+$"
let wpage = Senv.register_warn_category "inconsistent-page" let wpage = Senv.register_warn_category "inconsistent-page"
let wkind = Senv.register_warn_category "inconsistent-kind" let wkind = Senv.register_warn_category "inconsistent-kind"
...@@ -84,15 +81,6 @@ let check_page page name = ...@@ -84,15 +81,6 @@ let check_page page name =
Senv.warning ~wkey:wkind Senv.warning ~wkey:wkind
"Request '%s' shall not be published in protocol pages" name "Request '%s' shall not be published in protocol pages" name
let check_kind kind name =
let re,key = match kind with
| `GET -> re_get , "get|print"
| `SET -> re_set , "set"
| `EXEC -> re_exec , "exec|compute"
in try ignore (Str.search_forward re name 0) with Not_found ->
Senv.warning "Request '%s' shall be named with « %s »"
name key
(* -------------------------------------------------------------------------- *) (* -------------------------------------------------------------------------- *)
(* --- Multiple Fields Requests --- *) (* --- Multiple Fields Requests --- *)
(* -------------------------------------------------------------------------- *) (* -------------------------------------------------------------------------- *)
...@@ -256,7 +244,6 @@ let signature ...@@ -256,7 +244,6 @@ let signature
~page ~kind ~name ~descr ?(details=[]) ?input ?output () = ~page ~kind ~name ~descr ?(details=[]) ?input ?output () =
check_name name ; check_name name ;
check_page page name ; check_page page name ;
check_kind kind name ;
let input = match input with None -> Pnone | Some d -> Pdata d in let input = match input with None -> Pnone | Some d -> Pdata d in
let output = match output with None -> Rnone | Some d -> Rdata d in let output = match output with None -> Rnone | Some d -> Rdata d in
{ {
......
...@@ -30,7 +30,7 @@ let check_plugin plugin name = ...@@ -30,7 +30,7 @@ let check_plugin plugin name =
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 &&
String.get n k = '.') String.get n k = '-')
then then
Senv.warning ~wkey:Senv.wpage Senv.warning ~wkey:Senv.wpage
"Data %S shall be named « %s-* »" "Data %S shall be named « %s-* »"
......
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