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
be5816a8
Commit
be5816a8
authored
Oct 05, 2007
by
Pietro Abate
Browse files
[r2005-05-17 18:45:09 by beppe] Empty log message
Original author: beppe Date: 2005-05-17 18:45:09+00:00
parent
96b1764b
Changes
1
Show whitespace changes
Inline
Side-by-side
types/builtin.ml
View file @
be5816a8
...
...
@@ -211,12 +211,27 @@ unary_op_warning "int_of"
string
intstr
int
(
fun
v
->
let
(
s
,_
)
=
Value
.
get_string_utf8
v
in
let
str
=
U
.
get_str
s
in
try
let
modifier
=
str
.
[(
String
.
index
str
'
0
'
)
+
1
]
in
if
(
modifier
=
'
x'
||
modifier
=
'
X'
||
modifier
=
'
b'
||
modifier
=
'
B'
||
modifier
=
'
o'
||
modifier
=
'
O'
)
then
Value
.
Integer
(
Intervals
.
V
.
from_int
(
int_of_string
(
str
)))
else
Value
.
Integer
(
Intervals
.
V
.
mk
(
str
))
with
_
->
(
try
Value
.
Integer
(
Intervals
.
V
.
mk
(
str
))
with
Failure
_
->
raise
exn_int_of
));;
(* It was like that *)
(* try Value.Integer (Intervals.V.mk (U.get_str s)) *)
(* UTF-8 is ASCII compatible ! *)
(* modified to allow 0x 0b 0o notations *)
try
Value
.
Integer
(
Intervals
.
V
.
from_int
(
int_of_string
(
U
.
get_str
s
)))
with
Failure
_
->
raise
exn_int_of
);;
register_fun
"atom_of"
string
atom
...
...
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