mirror of
https://github.com/CatalaLang/catala.git
synced 2024-09-19 00:15:39 +03:00
Fix plugins compilation
This commit is contained in:
parent
a0405e31d5
commit
ce17d8e563
@ -23,7 +23,7 @@ let () =
|
||||
~language:(Some language) ~debug:false ~color:Never ~trace ()
|
||||
in
|
||||
let prg, ctx, _type_order =
|
||||
Passes.dcalc options ~includes:Catala_utils.File.Tree.empty ~optimize:false
|
||||
Passes.dcalc options ~includes:[] ~optimize:false
|
||||
~check_invariants:false
|
||||
in
|
||||
Shared_ast.Interpreter.interpret_program_dcalc prg
|
||||
|
@ -50,9 +50,12 @@ let load_dir d =
|
||||
if f.[0] = '.' then ()
|
||||
else
|
||||
let f = Filename.concat d f in
|
||||
if Sys.is_directory f then aux f
|
||||
else if List.exists (Filename.check_suffix f) dynlink_exts then
|
||||
load_file f)
|
||||
match Sys.is_directory f with
|
||||
| true -> aux f
|
||||
| false ->
|
||||
if List.exists (Filename.check_suffix f) dynlink_exts then
|
||||
load_file f
|
||||
| exception (Sys_error _) -> ())
|
||||
(Sys.readdir d)
|
||||
in
|
||||
aux d
|
||||
|
@ -472,7 +472,7 @@ let run
|
||||
let term =
|
||||
let open Cmdliner.Term in
|
||||
const run
|
||||
$ Driver.Commands.include_flags
|
||||
$ Cli.Flags.include_dirs
|
||||
$ Cli.Flags.output
|
||||
$ Cli.Flags.optimize
|
||||
$ Cli.Flags.check_invariants
|
||||
|
@ -23,7 +23,7 @@ type flags = {
|
||||
merge_level : int;
|
||||
format : [ `Dot | `Convert of string ];
|
||||
show : string option;
|
||||
output : string option;
|
||||
output : Cli.raw_file option;
|
||||
base_src_url : string;
|
||||
}
|
||||
|
||||
@ -1385,12 +1385,12 @@ let options =
|
||||
$ Cli.Flags.output
|
||||
$ base_src_url)
|
||||
|
||||
let run includes build_dirs optimize ex_scope explain_options global_options =
|
||||
let run includes optimize ex_scope explain_options global_options =
|
||||
let prg, ctx, _ =
|
||||
Driver.Passes.dcalc global_options ~includes ~optimize
|
||||
~check_invariants:false
|
||||
in
|
||||
Interpreter.load_runtime_modules ~build_dirs prg;
|
||||
Interpreter.load_runtime_modules prg;
|
||||
let scope = Driver.Commands.get_scope_uid ctx ex_scope in
|
||||
(* let result_expr, env = interpret_program prg scope in *)
|
||||
let g, base_vars, env = program_to_graph explain_options prg scope in
|
||||
@ -1416,7 +1416,7 @@ let run includes build_dirs optimize ex_scope explain_options global_options =
|
||||
| { output; _ } ->
|
||||
let _, with_out = Driver.Commands.get_output global_options output in
|
||||
with_out (fun oc -> output_string oc dot_content);
|
||||
fun f -> f (Option.value ~default:"-" output)
|
||||
fun f -> f (Option.value ~default:"-" (Option.map Cli.globals.path_rewrite output))
|
||||
in
|
||||
with_dot_file
|
||||
@@ fun dotfile ->
|
||||
@ -1436,8 +1436,7 @@ let run includes build_dirs optimize ex_scope explain_options global_options =
|
||||
let term =
|
||||
let open Cmdliner.Term in
|
||||
const run
|
||||
$ Driver.Commands.include_flags
|
||||
$ Cli.Flags.build_dirs
|
||||
$ Cli.Flags.include_dirs
|
||||
$ Cli.Flags.optimize
|
||||
$ Cli.Flags.ex_scope
|
||||
$ options
|
||||
|
@ -233,7 +233,7 @@ let run
|
||||
let term =
|
||||
let open Cmdliner.Term in
|
||||
const run
|
||||
$ Driver.Commands.include_flags
|
||||
$ Cli.Flags.include_dirs
|
||||
$ Cli.Flags.output
|
||||
$ Cli.Flags.optimize
|
||||
$ Cli.Flags.check_invariants
|
||||
|
@ -257,11 +257,11 @@ let interpret_program (prg : ('dcalc, 'm) gexpr program) (scope : ScopeName.t) :
|
||||
|
||||
(* -- Plugin registration -- *)
|
||||
|
||||
let run includes build_dirs optimize check_invariants ex_scope options =
|
||||
let run includes optimize check_invariants ex_scope options =
|
||||
let prg, ctx, _ =
|
||||
Driver.Passes.dcalc options ~includes ~optimize ~check_invariants
|
||||
in
|
||||
Interpreter.load_runtime_modules ~build_dirs prg;
|
||||
Interpreter.load_runtime_modules prg;
|
||||
let scope = Driver.Commands.get_scope_uid ctx ex_scope in
|
||||
let result_expr, _env = interpret_program prg scope in
|
||||
let fmt = Format.std_formatter in
|
||||
@ -270,8 +270,7 @@ let run includes build_dirs optimize check_invariants ex_scope options =
|
||||
let term =
|
||||
let open Cmdliner.Term in
|
||||
const run
|
||||
$ Driver.Commands.include_flags
|
||||
$ Cli.Flags.build_dirs
|
||||
$ Cli.Flags.include_dirs
|
||||
$ Cli.Flags.optimize
|
||||
$ Cli.Flags.check_invariants
|
||||
$ Cli.Flags.ex_scope
|
||||
|
@ -45,7 +45,7 @@ let run
|
||||
let term =
|
||||
let open Cmdliner.Term in
|
||||
const run
|
||||
$ Driver.Commands.include_flags
|
||||
$ Cli.Flags.include_dirs
|
||||
$ Cli.Flags.output
|
||||
$ Cli.Flags.optimize
|
||||
$ Cli.Flags.check_invariants
|
||||
|
Loading…
Reference in New Issue
Block a user