Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
why3
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
119
Issues
119
List
Boards
Labels
Service Desk
Milestones
Merge Requests
16
Merge Requests
16
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Why3
why3
Commits
c73e212f
Commit
c73e212f
authored
Mar 31, 2015
by
Stefan Berghofer
Committed by
MARCHE Claude
Apr 08, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added sanitizer taking additional encoder for last letter
parent
31af7785
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
6 deletions
+12
-6
src/core/ident.ml
src/core/ident.ml
+9
-6
src/core/ident.mli
src/core/ident.mli
+3
-0
No files found.
src/core/ident.ml
View file @
c73e212f
...
...
@@ -198,11 +198,14 @@ let char_to_alnumus c =
let char_to_lalnumus c =
match c with '_' | ' ' -> "
_
" | _ -> char_to_lalnum c
let sanitizer
head re
st n =
let sanitizer
' head rest la
st n =
let lst = ref [] in
let code c = lst := rest c :: !lst in
let code i c = lst :=
(if i = 0 then head
else if i = String.length n - 1 then last
else rest) c :: !lst in
let n = if n = "" then "
zilch
" else n in
String.iter code n;
let rst = List.tl (List.rev !lst) in
let cs = head (String.get n 0) :: rst in
String.concat "" cs
String.iter
i
code n;
String.concat "" (List.rev !lst)
let sanitizer head rest n = sanitizer' head rest rest n
src/core/ident.mli
View file @
c73e212f
...
...
@@ -92,6 +92,9 @@ val forget_id : ident_printer -> ident -> unit
val
forget_all
:
ident_printer
->
unit
(** forget all idents *)
val
sanitizer'
:
(
char
->
string
)
->
(
char
->
string
)
->
(
char
->
string
)
->
string
->
string
(** generic sanitizer taking a separate encoder for the first and last letter *)
val
sanitizer
:
(
char
->
string
)
->
(
char
->
string
)
->
string
->
string
(** generic sanitizer taking a separate encoder for the first letter *)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment