summaryrefslogtreecommitdiffstats
path: root/otherlibs/labltk/compiler
diff options
context:
space:
mode:
Diffstat (limited to 'otherlibs/labltk/compiler')
-rw-r--r--otherlibs/labltk/compiler/Makefile12
-rw-r--r--otherlibs/labltk/compiler/compile.ml6
-rw-r--r--otherlibs/labltk/compiler/maincompile.ml36
3 files changed, 27 insertions, 27 deletions
diff --git a/otherlibs/labltk/compiler/Makefile b/otherlibs/labltk/compiler/Makefile
index a2b845331..f209c9182 100644
--- a/otherlibs/labltk/compiler/Makefile
+++ b/otherlibs/labltk/compiler/Makefile
@@ -31,11 +31,11 @@ ppyac.ml ppyac.mli: ppyac.mly
copyright.ml: copyright
(echo "let copyright=\"\\"; \
- cat copyright; \
+ sed -e 's/$/\\n\\/' copyright; \
echo "\""; \
- echo "let write ~w = w copyright;;") > copyright.ml
+ echo "let write ~w = w copyright;;") > copyright.ml
-clean :
+clean :
rm -f *.cm* parser.ml parser.mli lexer.ml copyright.ml
rm -f pplex.ml ppyac.ml ppyac.mli ppyac.output
rm -f tkcompiler$(EXE) pp$(EXE) parser.output
@@ -44,7 +44,7 @@ scratch :
rm -f *.cm* parser.ml parser.mli lexer.ml tkcompiler$(EXE)
rm -f *.cm* pplex.ml ppyac.ml ppyac.mli pp$(EXE)
-install:
+install:
cp tkcompiler$(EXE) $(INSTALLDIR)
cp pp$(EXE) $(INSTALLDIR)
@@ -52,10 +52,10 @@ install:
.SUFFIXES : .mli .ml .cmi .cmo .mlp
.mli.cmi:
- $(CAMLCOMP) -g $(COMPFLAGS) -I ../support $<
+ $(CAMLCOMP) $(COMPFLAGS) -I ../support $<
.ml.cmo:
- $(CAMLCOMP) -g $(COMPFLAGS) -I ../support $<
+ $(CAMLCOMP) $(COMPFLAGS) -I ../support $<
depend: parser.ml parser.mli lexer.ml pplex.ml ppyac.ml ppyac.mli
$(CAMLDEP) *.mli *.ml > .depend
diff --git a/otherlibs/labltk/compiler/compile.ml b/otherlibs/labltk/compiler/compile.ml
index a361e5014..529c0548e 100644
--- a/otherlibs/labltk/compiler/compile.ml
+++ b/otherlibs/labltk/compiler/compile.ml
@@ -323,9 +323,9 @@ let write_type ~intf:w ~impl:w' name ~def:typdef =
let rec converterTKtoCAML ~arg = function
| Int -> "int_of_string " ^ arg
| Float -> "float_of_string " ^ arg
- | Bool -> "(match " ^ arg ^ " with
- | \"1\" -> true
- | \"0\" -> false
+ | Bool -> "(match " ^ arg ^ " with\n\
+ | \"1\" -> true\n\
+ | \"0\" -> false\n\
| s -> Pervasives.raise (Invalid_argument (\"cTKtoCAMLbool\" ^ s)))"
| Char -> "String.get " ^ arg ^ " 0"
| String -> arg
diff --git a/otherlibs/labltk/compiler/maincompile.ml b/otherlibs/labltk/compiler/maincompile.ml
index 144e47cee..80118fa9b 100644
--- a/otherlibs/labltk/compiler/maincompile.ml
+++ b/otherlibs/labltk/compiler/maincompile.ml
@@ -277,14 +277,14 @@ let compile () =
let oc = open_out_bin (destfile "camltk.ml") in
Copyright.write ~w:(output_string oc);
output_string oc
-"(** This module Camltk provides the module name spaces of the CamlTk API.
-
- The users of the CamlTk API should open this module first to access
- the types, functions and modules of the CamlTk API easier.
- For the documentation of each sub modules such as [Button] and [Toplevel],
- refer to its defintion file, [cButton.mli], [cToplevel.mli], etc.
- *)
-
+"(** This module Camltk provides the module name spaces of the CamlTk API.\n\
+\n\
+ The users of the CamlTk API should open this module first to access\n\
+ the types, functions and modules of the CamlTk API easier.\n\
+ For the documentation of each sub modules such as [Button] and [Toplevel],\n\
+ refer to its defintion file, [cButton.mli], [cToplevel.mli], etc.\n\
+ *)\n\
+\n\
";
output_string oc "include CTk\n";
output_string oc "module Tk = CTk\n";
@@ -297,17 +297,17 @@ let compile () =
end else begin
let oc = open_out_bin (destfile "labltk.ml") in
Copyright.write ~w:(output_string oc);
- output_string oc
-"(** This module Labltk provides the module name spaces of the LablTk API,
- useful to call LablTk functions inside CamlTk programs. 100% LablTk users
- do not need to use this. *)
-
+ output_string oc
+"(** This module Labltk provides the module name spaces of the LablTk API,\n\
+ useful to call LablTk functions inside CamlTk programs. 100% LablTk users\n\
+ do not need to use this. *)\n\
+\n\
";
- output_string oc "module Widget = Widget;;
-module Protocol = Protocol;;
-module Textvariable = Textvariable;;
-module Fileevent = Fileevent;;
-module Timer = Timer;;
+ output_string oc "module Widget = Widget;;\n\
+module Protocol = Protocol;;\n\
+module Textvariable = Textvariable;;\n\
+module Fileevent = Fileevent;;\n\
+module Timer = Timer;;\n\
";
Hashtbl.iter (fun name _ ->
let cname = realname name in