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
7409d6d2
Commit
7409d6d2
authored
Oct 05, 2007
by
Pietro Abate
Browse files
[r2004-06-25 13:34:21 by afrisch] Does not hide Not_found raised by find_node
Original author: afrisch Date: 2004-06-25 13:34:21+00:00
parent
c20932f0
Changes
1
Hide whitespace changes
Inline
Side-by-side
driver/cduce.ml
View file @
7409d6d2
...
...
@@ -281,21 +281,8 @@ ifdef ML_INTERFACE then
let
check_ml
cu
id
out_dir
out
=
let
fnam
=
String
.
copy
cu
in
String
.
set
fnam
0
(
Char
.
lowercase
(
String
.
get
fnam
0
)
);
try
let
name
=
fnam
^
".cmi"
in
let
file
=
List
.
find
(
fun
dir
->
Sys
.
file_exists
(
Filename
.
concat
dir
name
)
)
!
Librarian
.
obj_path
in
if
file
=
""
then
raise
Not_found
;
let
file
=
Filename
.
concat
file
name
in
let
ml_cu
=
ML
.
CompUnit
.
from_bytecode
file
cu
and
cd_cu
=
Ml_cduce
.
CompUnit
.
from_types_cu
cu
id
in
Ml_checker
.
run
ml_cu
cd_cu
;
let
out
=
open_out
(
Filename
.
concat
out_dir
(
fnam
^
".ml"
)
)
in
let
fmt
=
Format
.
formatter_of_out_channel
out
in
Ml_generator
.
ML
.
generate
fmt
fnam
ml_cu
cd_cu
;
close_out
out
;
with
Not_found
->
(
let
cmi_not_found
()
=
let
name
=
fnam
^
".mli"
in
let
has_cmi
=
List
.
exists
(
fun
dir
->
Sys
.
file_exists
(
Filename
.
concat
dir
name
)
...
...
@@ -304,7 +291,31 @@ ifdef ML_INTERFACE then
Format
.
eprintf
"Warning: found %s.mli but no %s.cmi: forgotten compilation?@."
fnam
fnam
;
)
String
.
set
fnam
0
(
Char
.
lowercase
(
String
.
get
fnam
0
)
);
in
let
cmi_found
file
=
let
ml_cu
=
ML
.
CompUnit
.
from_bytecode
file
cu
and
cd_cu
=
Ml_cduce
.
CompUnit
.
from_types_cu
cu
id
in
Ml_checker
.
run
ml_cu
cd_cu
;
let
out
=
open_out
(
Filename
.
concat
out_dir
(
fnam
^
".ml"
)
)
in
let
fmt
=
Format
.
formatter_of_out_channel
out
in
Ml_generator
.
ML
.
generate
fmt
fnam
ml_cu
cd_cu
;
close_out
out
in
let
name
=
fnam
^
".cmi"
in
let
file
=
try
let
file
=
List
.
find
(
fun
dir
->
Sys
.
file_exists
(
Filename
.
concat
dir
name
)
)
!
Librarian
.
obj_path
in
if
file
=
""
then
None
else
Some
(
Filename
.
concat
file
name
)
with
Not_found
->
None
in
match
file
with
|
Some
file
->
cmi_found
file
|
None
->
cmi_not_found
()
else
let
check_ml
cu
id
out_dir
out
=
()
;;
...
...
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