Commit 2414d823 authored by bguillaum's avatar bguillaum

handling of symbolic links

git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/semagramme/libcaml-grew/trunk@9222 7838e531-6607-4d57-9587-6c381814729c
parent 5f56ebfd
OCB_FLAGS = -use-ocamlfind -use-menhir -I src OCB_FLAGS = -use-ocamlfind -use-menhir -I src
OCB = ocamlbuild $(OCB_FLAGS) OCB = ocamlbuild $(OCB_FLAGS)
LIB_FILES = libgrew.cma libgrew.cmxa libgrew.a libgrew.cmi libgrew_types.cmi libgrew.cmx LIB_FILES = libgrew.cma libgrew.cmxa libgrew.a libgrew.cmi libgrew_types.cmi libgrew.cmx
INSTALL_FILES = $(LIB_FILES:%=_build/src/%) INSTALL_FILES = $(LIB_FILES:%=_build/src/%)
......
true: package(conll dep2pict camomile, cairo2, log) true: package(unix, conll, dep2pict, camomile, cairo2, log)
...@@ -66,11 +66,18 @@ module Loader = struct ...@@ -66,11 +66,18 @@ module Loader = struct
@return a syntactic tree of the parsed file @return a syntactic tree of the parsed file
*) *)
let grs main_file = let grs main_file =
let grs_wi = parse_file_to_grs_wi main_file in let real_dir =
match (Unix.lstat main_file).Unix.st_kind with
| Unix.S_LNK -> Filename.dirname (Unix.readlink main_file)
| _ -> Filename.dirname main_file in
let unlink file = Filename.concat real_dir (Filename.basename file) in
let grs_wi = parse_file_to_grs_wi (unlink main_file) in
let domain = match grs_wi.Ast.domain_wi with let domain = match grs_wi.Ast.domain_wi with
| None -> None | None -> None
| Some (Ast.Dom d) -> Some d | Some (Ast.Dom d) -> Some d
| Some (Ast.Dom_file file) -> Some (domain file) in | Some (Ast.Dom_file file) -> Some (domain (unlink file)) in
let rec flatten_modules current_file = function let rec flatten_modules current_file = function
| [] -> [] | [] -> []
| Ast.Modul m :: tail -> | Ast.Modul m :: tail ->
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment