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
6067321b
Commit
6067321b
authored
Oct 05, 2007
by
Pietro Abate
Browse files
[r2006-03-17 13:25:49 by afrisch] Utiliser les -I pour les includes
Original author: afrisch Date: 2006-03-17 13:27:38+00:00
parent
a01634b4
Changes
7
Hide whitespace changes
Inline
Side-by-side
driver/librarian.ml
View file @
6067321b
...
...
@@ -52,9 +52,6 @@ let mk name descr typing compile code ext_info depends =
let
magic
=
"CDUCE:compunit:00007"
let
obj_path
=
ref
[
""
]
let
has_obj
n
=
let
base
=
U
.
to_string
n
^
".cdo"
in
List
.
exists
(
fun
p
->
Sys
.
file_exists
(
Filename
.
concat
p
base
))
!
obj_path
...
...
driver/librarian.mli
View file @
6067321b
...
...
@@ -8,8 +8,6 @@ exception NoImplementation of U.t
val
name
:
Compunit
.
t
->
U
.
t
val
run_loaded
:
bool
ref
val
obj_path
:
string
list
ref
val
compile_save
:
bool
->
U
.
t
->
string
->
string
->
unit
val
compile_run
:
bool
->
U
.
t
->
string
->
unit
val
load_run
:
U
.
t
->
unit
...
...
driver/run.ml
View file @
6067321b
...
...
@@ -29,8 +29,8 @@ let specs =
"(for --compile) show types of exported values"
;
"--obj-dir"
,
Arg
.
String
(
fun
s
->
out_dir
:=
s
::
!
out_dir
)
,
"(for --compile) directory for the compiled .cdo file"
;
"-I"
,
Arg
.
String
(
fun
s
->
L
ibraria
n
.
obj_path
:=
s
::!
L
ibraria
n
.
obj_path
)
,
" add one directory to the lookup path for .cdo
and .cmi
files"
;
"-I"
,
Arg
.
String
(
fun
s
->
L
ocatio
n
.
obj_path
:=
s
::!
L
ocatio
n
.
obj_path
)
,
" add one directory to the lookup path for .cdo
/.cmi and include
files"
;
"--stdin"
,
Arg
.
Unit
(
fun
()
->
src
:=
""
::
!
src
)
,
" read CDuce script on standard input"
;
"--arg"
,
Arg
.
Rest
(
fun
s
->
args
:=
s
::
!
args
)
,
...
...
parser/location.ml
View file @
6067321b
...
...
@@ -165,3 +165,16 @@ let protect_op op =
if
(
!
protected
)
then
raise
(
Generic
(
op
^
": operation not authorized in the web prototype"
))
let
obj_path
=
ref
[
""
]
let
resolve_filename
s
=
if
Filename
.
is_relative
s
then
try
let
p
=
List
.
find
(
fun
p
->
Sys
.
file_exists
(
Filename
.
concat
p
s
))
(
current_dir
()
::
!
obj_path
)
in
Filename
.
concat
p
s
with
Not_found
->
s
else
s
parser/location.mli
View file @
6067321b
...
...
@@ -48,3 +48,7 @@ val loc_of_pos : int * int -> loc
val
set_protected
:
bool
->
unit
val
is_protected
:
unit
->
bool
val
protect_op
:
string
->
unit
val
obj_path
:
string
list
ref
val
resolve_filename
:
string
->
string
parser/parser.ml
View file @
6067321b
...
...
@@ -176,11 +176,8 @@ EXTEND
|
"#"
;
IDENT
"help"
->
[
mk
_loc
(
Directive
`Help
)
]
|
"#"
;
IDENT
"builtins"
->
[
mk
_loc
(
Directive
`Builtins
)
]
|
"include"
;
s
=
STRING2
->
let
s
=
if
Filename
.
is_relative
s
then
Filename
.
concat
(
Location
.
current_dir
()
)
s
else
s
in
protect_op
"File inclusion"
;
let
s
=
Location
.
resolve_filename
s
in
(* avoid looping; should issue an error ? *)
(* it is possible to have looping with x/../x/../x/.. ....
Need to canonicalize filename *)
...
...
web/manual/interpreter.xml
View file @
6067321b
...
...
@@ -80,8 +80,8 @@ Specify where to put the <code>.cdo</code> file (default: same directory as the
source file).
</li>
<li>
<code>
--I %%directory%%
</code>
Add a directory to the search path for
<code>
.cdo
</code>
and
<code>
.cmi
</code>
files.
</li>
Add a directory to the search path for
<code>
.cdo
</code>
,
<code>
.cmi
</code>
and include
files.
</li>
<li>
<code>
--stdin
</code>
. Read CDuce script from standard input.
</li>
...
...
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