Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
frama-c
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pub
frama-c
Commits
53d43676
Commit
53d43676
authored
5 years ago
by
David Bühler
Browse files
Options
Downloads
Patches
Plain Diff
[server] Removes some constraints on request naming.
parent
4da839f5
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/plugins/server/request.ml
+1
-14
1 addition, 14 deletions
src/plugins/server/request.ml
with
1 addition
and
14 deletions
src/plugins/server/request.ml
+
1
−
14
View file @
53d43676
...
@@ -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
{
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment