aboutsummaryrefslogtreecommitdiffhomepage
path: root/plugins/extraction
diff options
context:
space:
mode:
authorGravatar Guillaume Melquiond <guillaume.melquiond@inria.fr>2015-03-21 13:54:46 +0100
committerGravatar Guillaume Melquiond <guillaume.melquiond@inria.fr>2015-03-21 13:54:46 +0100
commit21771adc7454ae186823b3f30d43c2fb80d70fc2 (patch)
tree01018e82305ae39d7454fa6cb726b6c8039b9ef2 /plugins/extraction
parent58521e6066974833bb83e98a6bb17feb0c1fee90 (diff)
Properly capitalize filenames when extracting to Haskell. (Fix for bug #3221)
Diffstat (limited to 'plugins/extraction')
-rw-r--r--plugins/extraction/extract_env.ml3
-rw-r--r--plugins/extraction/haskell.ml1
-rw-r--r--plugins/extraction/miniml.mli1
-rw-r--r--plugins/extraction/ocaml.ml1
-rw-r--r--plugins/extraction/scheme.ml1
5 files changed, 6 insertions, 1 deletions
diff --git a/plugins/extraction/extract_env.ml b/plugins/extraction/extract_env.ml
index 90ee6d0ef..5ea4fb763 100644
--- a/plugins/extraction/extract_env.ml
+++ b/plugins/extraction/extract_env.ml
@@ -440,7 +440,8 @@ let mono_filename f =
let module_filename mp =
let f = file_of_modfile mp in
let d = descr () in
- Some (f^d.file_suffix), Option.map ((^) f) d.sig_suffix, Id.of_string f
+ let p = d.file_naming mp ^ d.file_suffix in
+ Some p, Option.map ((^) f) d.sig_suffix, Id.of_string f
(*s Extraction of one decl to stdout. *)
diff --git a/plugins/extraction/haskell.ml b/plugins/extraction/haskell.ml
index d8eda87d6..3e5a90efe 100644
--- a/plugins/extraction/haskell.ml
+++ b/plugins/extraction/haskell.ml
@@ -360,6 +360,7 @@ let pp_struct =
let haskell_descr = {
keywords = keywords;
file_suffix = ".hs";
+ file_naming = string_of_modfile;
preamble = preamble;
pp_struct = pp_struct;
sig_suffix = None;
diff --git a/plugins/extraction/miniml.mli b/plugins/extraction/miniml.mli
index 1e491d36f..b7dee6cb1 100644
--- a/plugins/extraction/miniml.mli
+++ b/plugins/extraction/miniml.mli
@@ -197,6 +197,7 @@ type language_descr = {
(* Concerning the source file *)
file_suffix : string;
+ file_naming : module_path -> string;
(* the second argument is a comment to add to the preamble *)
preamble :
Id.t -> std_ppcmds option -> module_path list -> unsafe_needs ->
diff --git a/plugins/extraction/ocaml.ml b/plugins/extraction/ocaml.ml
index 85f18a093..8c482b4b1 100644
--- a/plugins/extraction/ocaml.ml
+++ b/plugins/extraction/ocaml.ml
@@ -746,6 +746,7 @@ let pp_decl d = try pp_decl d with Failure "empty phrase" -> mt ()
let ocaml_descr = {
keywords = keywords;
file_suffix = ".ml";
+ file_naming = file_of_modfile;
preamble = preamble;
pp_struct = pp_struct;
sig_suffix = Some ".mli";
diff --git a/plugins/extraction/scheme.ml b/plugins/extraction/scheme.ml
index 69dea25aa..99b4fd448 100644
--- a/plugins/extraction/scheme.ml
+++ b/plugins/extraction/scheme.ml
@@ -225,6 +225,7 @@ let pp_struct =
let scheme_descr = {
keywords = keywords;
file_suffix = ".scm";
+ file_naming = file_of_modfile;
preamble = preamble;
pp_struct = pp_struct;
sig_suffix = None;