Commit c5ea5f68 authored by Bruno Guillaume's avatar Bruno Guillaume

version 0.47.1: Fix bug in grs loading with relative path

parent 9b0ec604
## 0.47.1 (2018/03/16)
* fix bug in grs loading with relative path
# 0.47.0 (2018/03/13)
* Add conll_fields in domain definition
* graphs are managing the own domain (change types in library)
......
0.47.0
\ No newline at end of file
0.47.1
\ No newline at end of file
......@@ -561,7 +561,7 @@ module Grs = struct
| New_ast.Labels _ -> None
| New_ast.Conll_fields _ -> None
| New_ast.Import _ -> Error.bug "[load] Import: inconsistent ast for new_grs"
| New_ast.Include _ -> Error.bug "[load] Inlcude: inconsistent ast for new_grs"
| New_ast.Include _ -> Error.bug "[load] Include: inconsistent ast for new_grs"
| x -> Some (build_decl ?domain x)
) ast in
......
......@@ -148,8 +148,6 @@ module Loader = struct
| Unix.S_LNK -> Filename.dirname (Unix.readlink file)
| _ -> Filename.dirname file
let unlink dir file = Filename.concat dir (Filename.basename file)
let loc_new_grs file =
try
Global.new_file file;
......@@ -164,7 +162,7 @@ module Loader = struct
List.fold_left
(fun acc decl -> match decl with
| New_ast.Import filename ->
let real_file = unlink dir filename in
let real_file = Filename.concat dir filename in
let pack_name = match CCString.chop_suffix ~suf:".grs" filename with
| Some x -> x
| None -> Error.build "Imported file must have the \".grs\" file extension" in
......@@ -172,7 +170,7 @@ module Loader = struct
let unfolded_sub = unfold_new_grs (real_dir real_file) false sub in
New_ast.Package (Loc.file filename, pack_name, unfolded_sub) :: acc
| New_ast.Include filename ->
let real_file = unlink dir filename in
let real_file = Filename.concat dir filename in
let sub = loc_new_grs real_file in
let unfolded_sub = unfold_new_grs (real_dir real_file) top sub in
unfolded_sub @ acc
......
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