2021-02-12 19:20:14 +03:00
|
|
|
(* This file is part of the Catala compiler, a specification language for tax
|
2021-05-27 19:56:47 +03:00
|
|
|
and social benefits computation rules. Copyright (C) 2020 Inria,
|
|
|
|
contributors: Denis Merigoux <denis.merigoux@inria.fr>, Emile Rolley
|
|
|
|
<emile.rolley@tuta.io>
|
2021-02-12 19:20:14 +03:00
|
|
|
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
|
|
|
use this file except in compliance with the License. You may obtain a copy of
|
|
|
|
the License at
|
|
|
|
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
|
|
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
|
|
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
|
|
License for the specific language governing permissions and limitations under
|
|
|
|
the License. *)
|
|
|
|
|
2024-03-15 16:23:30 +03:00
|
|
|
open Global
|
2023-06-28 16:57:52 +03:00
|
|
|
|
2023-03-13 15:40:10 +03:00
|
|
|
val languages : (string * backend_lang) list
|
|
|
|
|
|
|
|
val language_code : backend_lang -> string
|
|
|
|
(** Returns the lowercase two-letter language code *)
|
|
|
|
|
2023-09-26 12:42:46 +03:00
|
|
|
val file_lang : file -> backend_lang
|
2024-03-19 17:23:06 +03:00
|
|
|
(** Associates a file extension with its corresponding
|
|
|
|
{!type: Global.backend_lang} string representation. *)
|
2023-09-26 12:42:46 +03:00
|
|
|
|
2023-06-28 16:57:52 +03:00
|
|
|
(** {2 CLI flags and options} *)
|
|
|
|
|
2024-03-19 17:23:06 +03:00
|
|
|
val when_opt : when_enum Cmdliner.Arg.conv
|
2024-03-15 16:23:30 +03:00
|
|
|
|
2023-06-28 16:57:52 +03:00
|
|
|
module Flags : sig
|
|
|
|
open Cmdliner
|
|
|
|
|
|
|
|
module Global : sig
|
|
|
|
val flags : options Term.t
|
|
|
|
(** Global flags available to all commands. Note that parsing this term also
|
|
|
|
performs some side-effects into [GlobalRefs] and sets up signal/error
|
2023-09-26 12:42:46 +03:00
|
|
|
processing. Sets [input_src] to [Stdin "-stdin-"], use [options] for the
|
2023-06-28 16:57:52 +03:00
|
|
|
full parser *)
|
|
|
|
|
|
|
|
val options : options Term.t
|
|
|
|
(** [flags] plus an additional positional argument for the input file *)
|
|
|
|
end
|
|
|
|
|
|
|
|
(** Parsers for all flags and options that commands can use *)
|
|
|
|
|
|
|
|
val check_invariants : bool Term.t
|
2023-11-02 16:36:55 +03:00
|
|
|
val no_typing : bool Term.t
|
2023-06-28 16:57:52 +03:00
|
|
|
val wrap_weaved_output : bool Term.t
|
|
|
|
val print_only_law : bool Term.t
|
|
|
|
val ex_scope : string Term.t
|
|
|
|
val ex_scope_opt : string option Term.t
|
|
|
|
val ex_variable : string Term.t
|
2023-09-27 12:01:43 +03:00
|
|
|
val output : raw_file option Term.t
|
2023-06-28 16:57:52 +03:00
|
|
|
val optimize : bool Term.t
|
|
|
|
val closure_conversion : bool Term.t
|
2023-12-07 18:58:22 +03:00
|
|
|
val keep_special_ops : bool Term.t
|
2023-12-19 17:01:06 +03:00
|
|
|
val monomorphize_types : bool Term.t
|
2023-12-11 19:08:32 +03:00
|
|
|
val dead_value_assignment : bool Term.t
|
|
|
|
val no_struct_literals : bool Term.t
|
2023-09-27 12:01:43 +03:00
|
|
|
val include_dirs : raw_file list Term.t
|
2023-06-28 16:57:52 +03:00
|
|
|
val disable_counterexamples : bool Term.t
|
2024-02-22 19:02:00 +03:00
|
|
|
|
2024-02-15 20:19:04 +03:00
|
|
|
val extra_files : file list Term.t
|
2024-02-22 19:02:00 +03:00
|
|
|
(** for the 'latex' command *)
|
|
|
|
|
|
|
|
val lcalc : bool Term.t
|
|
|
|
(** for the 'interpret' command *)
|
2024-03-05 19:54:53 +03:00
|
|
|
|
2024-03-19 17:23:06 +03:00
|
|
|
val extension : string list Term.t
|
2024-03-05 19:54:53 +03:00
|
|
|
(** for the 'depends' command *)
|
|
|
|
|
|
|
|
val prefix : string option Term.t
|
|
|
|
(** for the 'depends' command *)
|
2023-06-28 16:57:52 +03:00
|
|
|
end
|
2022-03-04 21:25:06 +03:00
|
|
|
|
2023-06-28 16:57:52 +03:00
|
|
|
(** {2 Command-line application} *)
|
2022-03-04 21:25:06 +03:00
|
|
|
|
2021-02-11 20:48:59 +03:00
|
|
|
val version : string
|
2022-05-04 18:37:03 +03:00
|
|
|
val info : Cmdliner.Cmd.info
|
2023-06-28 16:57:52 +03:00
|
|
|
|
|
|
|
val s_plugins : string
|
|
|
|
(** Manpage section name for the installed plugins *)
|
|
|
|
|
|
|
|
exception Exit_with of int
|
|
|
|
(** Exit with a specific exit code (but less brutally than [Sys.exit] which
|
|
|
|
would bypass all finalisers) *)
|
2024-02-27 13:24:33 +03:00
|
|
|
|
|
|
|
(** {2 Other helpers} *)
|
|
|
|
|
|
|
|
val exec_dir : file
|
|
|
|
(** Returns the directory of the currently running executable *)
|