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
bd42472e
Commit
bd42472e
authored
Jan 29, 2008
by
Pietro Abate
Browse files
- now it is possible to run an object file specifying the full path
parent
d8355078
Changes
1
Hide whitespace changes
Inline
Side-by-side
driver/cduce.ml
View file @
bd42472e
...
...
@@ -140,7 +140,7 @@ let rec print_exn ppf = function
Format
.
fprintf
ppf
"Source filename must have extension .cd@."
;
|
InvalidObjectFilename
f
->
Format
.
fprintf
ppf
"Compilation error:@."
;
Format
.
fprintf
ppf
"Object filename must have extension .cdo
and no path
@."
;
Format
.
fprintf
ppf
"Object filename must have extension .cdo@."
;
|
Librarian
.
InvalidObject
f
->
Format
.
fprintf
ppf
"Invalid object file %s@."
f
|
Librarian
.
CannotOpen
f
->
...
...
@@ -341,15 +341,15 @@ let compile_run src =
with
exn
->
catch_exn
Format
.
err_formatter
exn
;
exit
1
let
run
obj
=
Cduce_loc
.
obj_path
:=
(
Filename
.
dirname
obj
)
::!
Cduce_loc
.
obj_path
;
let
obj
=
Filename
.
basename
obj
in
try
if
not
(
Filename
.
check_suffix
obj
".cdo"
)
||
(
Filename
.
basename
obj
<>
obj
)
then
raise
(
InvalidObjectFilename
obj
);
if
not
(
Filename
.
check_suffix
obj
".cdo"
)
then
raise
(
InvalidObjectFilename
obj
);
let
name
=
Filename
.
chop_suffix
(
Filename
.
basename
obj
)
".cdo"
in
let
name
=
U
.
mk_latin1
name
in
Librarian
.
load_run
name
with
exn
->
catch_exn
Format
.
err_formatter
exn
;
exit
1
let
dump_env
ppf
=
dump_env
ppf
!
typing_env
!
compile_env
let
eval
s
=
...
...
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