Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
cduce
cduce
Commits
ee950bff
Commit
ee950bff
authored
Oct 05, 2007
by
Pietro Abate
Browse files
[r2006-05-11 09:34:22 by afrisch] Utility for string literal in regexp
Original author: afrisch Date: 2006-05-11 09:34:23+00:00
parent
fafa50af
Changes
2
Hide whitespace changes
Inline
Side-by-side
typing/typepat.ml
View file @
ee950bff
...
...
@@ -534,6 +534,15 @@ let deferr s = raise (Patterns.Error s)
let
mk_weakstar
n
=
WeakStar
n
let
mk_seqcapt
x
n
=
SeqCapture
(
x
,
n
)
let
mk_str
s
=
let
j
=
Encodings
.
Utf8
.
end_index
s
in
let
rec
aux
i
=
if
Encodings
.
Utf8
.
equal_index
i
j
then
Epsilon
else
let
(
c
,
i
)
=
Encodings
.
Utf8
.
next
s
i
in
let
t
=
Types
.
char
(
Chars
.
atom
(
Chars
.
V
.
mk_int
c
))
in
Seq
(
Elem
(
mk_type
t
)
,
aux
i
)
in
aux
(
Encodings
.
Utf8
.
start_index
s
)
let
rec
prepare_regexp
vars
b
rvars
f
=
function
(* - vars: seq variables to be propagated top-down and added
to each captured element
...
...
typing/typepat.mli
View file @
ee950bff
...
...
@@ -42,6 +42,7 @@ val mk_alt: re -> re -> re
val
mk_star
:
re
->
re
val
mk_weakstar
:
re
->
re
val
mk_seqcapt
:
id
->
re
->
re
val
mk_str
:
Encodings
.
Utf8
.
t
->
re
val
rexp
:
re
->
node
val
rexp_simplify
:
mix
:
bool
->
re
->
node
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