Repository navigation
Expand file tree
/
Copy pathrescript_compiler_driver.mli
More file actions
39 lines (35 loc) · 1.73 KB
/
Copy pathrescript_compiler_driver.mli
File metadata and controls
39 lines (35 loc) · 1.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
type result = {exit_code: int; stdout: string; stderr: string}
val build_identity : string
(** A digest of the compiler implementation linked into this driver. The
standalone compiler and embedded callers therefore use the same identity
without fingerprinting a separately installed executable. *)
val run_request :
run_external:(string -> int * string * string) option ->
cwd:string ->
argv:string list ->
input:string ->
result
(** Run one compiler request in the logical working directory, with the command
line [bsc argv input]. [input] is the request's last argument: usually the
file to compile, but it can also be the value of a final option, as with
[-format]. Requests may
run concurrently on different domains: their compiler state is
request-local. Compiler and external-command stdout and stderr are captured
in the result, including for help, version, formatting, and reprinting
requests. Ordinary argument, parse, type, and compilation outcomes are
returned as an exit code and never terminate the host process; anything
else raises {!Compiler_request_output.Failed} with the output so far. The request resolves file
I/O against [cwd] without changing the process working directory. Request
state is restored on success and failure. *)
val run_request_with_hooks :
hooks:Compiler_request_state.hooks ->
run_external:(string -> int * string * string) option ->
cwd:string ->
argv:string list ->
input:string ->
result
(** {!run_request} with build-system callbacks attached to the request; see
{!Compiler_request_state.hooks}. *)
val run : string array -> int
(** Command-line entry point of the standalone [bsc]. It writes to the process's
stdout and stderr as it goes. *)