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
open Forester_core
type exit =
Fail | Finished
[@@deriving show]
type t =
| Quit of exit
| Build_import_graph
| Plant_assets
| Plant_foreign
| Done
| Load_all_configured_dirs
| Parse_all
| Expand_all
| Eval_all
| Load_tree of (Eio.Fs.dir_ty Eio.Path.t [@printer Eio.Path.pp])
| Parse of (Lsp.Uri.t [@printer fun fmt uri -> fprintf fmt "%s" (Lsp.Uri.to_string uri)])
| Expand of URI.t
| Eval of URI.t
| Query of (string, Vertex.t) Datalog_expr.query
| Query_results of (Vertex_set.t [@opaque])
| Report_errors of ((Reporter.Message.t Asai.Diagnostic.t [@opaque]) list * t)
| Run_jobs of Job.job Range.located list
[@@deriving show]
let report ~next_action ~errors =
if List.length errors > 0 then
Report_errors (errors, next_action)
else next_action