module Ed_ocamlbuild:OCamlbuild support, with some useful stuff for ocaml compilation handling.sig
..end
val commands : (string, string) Hashtbl.t
val default_build_command : string -> string
val output_name : string
val ocamlbuild_output : unit -> Ed_outputs.text_output
Ed_outputs.text_output
). The output
is created if it does not exist.val goto_error : string -> int -> int -> int -> string -> unit
goto_error file line start stop message
can be used to position
the active sourceview on the given file
, on the given line
and select on this line the characters from start
to stop
.
The message
is displayed in the message zone of the view's window.
This function is used to position the user on a compilation problem.type
problem = {
|
pb_file : |
|||
|
pb_line : |
|||
|
pb_start : |
|||
|
pb_stop : |
|||
|
pb_kind : |
(* | The error/warning message, with a character defining the kind of warning. | *) |
val warning_is_error : char -> bool
true
if the warning corresponding to the
given character must be considered as an error. It uses the
"warn_error"
global variable to know which warnings must be considered
as errors. The signification of this variable is the same as the
-warn-error
option of ocamlc
. This variable can be set with
the command set_global warn_error Avd
.val analyze_ocaml_compilation : (problem -> bool) -> string -> unit
analyze_ocaml_compilation f text
looks, in the ocaml compilation output
text
, for warnings and errors locations. When one is found, the
f
function is called. If this function returns true
, then
analyse_ocaml_compilation
continues to look for the next problem,
and so on. If f
returns false
, then the analyze is stopped.val run : ?output:Ed_outputs.text_output -> string -> unit
run command
runs the given command, displays its output in
the ocamlbuild output, and analyzes the output with
the Ed_ocamlbuild.analyze_ocaml_compilation
function, using the
Ed_ocamlbuild.warning_is_error
and Ed_ocamlbuild.goto_error
functions to eventually
position the active sourceview on the problem.output
: can be used to specify another output object to
use.val build : Ed_sourceview.sourceview -> 'a -> unit
build view args
proposes a compilation command which uses ocamlbuild,
to compile the file edited in the sourceview. The used can modify the
command before launching it. The Ed_ocamlbuild.run
function above is used to
run the compilation, display the result and eventually "jump" to the
compilation problem.
The command used is associated to the edited file, and this association
is stored in the directory where Chamo was launched, in the file
Ed_mode_ocaml_rc.local_rc_file
. So the command is kept and proposed
to the user when this function is called, rather than the default
ocamlbuild command returned by default_built_command
.