mirror of
https://github.com/CatalaLang/catala.git
synced 2024-11-08 07:51:43 +03:00
583e80993a
*Disclaimer*: This is intended for discussion My impression is that the with-exceptions backend is to be superseded by the without-exception backend, which is more general and more efficient. Therefore, seeing the added complexity of maintaining the two in parallel, I see no good reason to keep the with-exceptions version now that the equivalence of their semantics have been proved. It will also be nice to reduce divergences between the different backends ; and this should make further simplifications possible (e.g. some thunkings may no longer be needed) Of course I am ready to hear arguments in favor of keeping it, be it in the mid- or long-term. This patch removes the `--avoid-exceptions` flag, making it the only option, and the corresponding `with_exceptions` variant of the dcalc->lcalc translation. It doesn't do further simplifications.
95 lines
2.9 KiB
OCaml
95 lines
2.9 KiB
OCaml
(* This file is part of the Catala compiler, a specification language for tax
|
|
and social benefits computation rules. Copyright (C) 2020 Inria,
|
|
contributors: Denis Merigoux <denis.merigoux@inria.fr>, Emile Rolley
|
|
<emile.rolley@tuta.io>
|
|
|
|
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. *)
|
|
|
|
open Global
|
|
|
|
val languages : (string * backend_lang) list
|
|
|
|
val language_code : backend_lang -> string
|
|
(** Returns the lowercase two-letter language code *)
|
|
|
|
val file_lang : file -> backend_lang
|
|
(** Associates a file extension with its corresponding
|
|
{!type: Global.backend_lang} string representation. *)
|
|
|
|
(** {2 CLI flags and options} *)
|
|
|
|
val when_opt : when_enum Cmdliner.Arg.conv
|
|
|
|
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
|
|
processing. Sets [input_src] to [Stdin "-stdin-"], use [options] for the
|
|
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
|
|
val no_typing : bool Term.t
|
|
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
|
|
val output : raw_file option Term.t
|
|
val optimize : bool Term.t
|
|
val closure_conversion : bool Term.t
|
|
val keep_special_ops : bool Term.t
|
|
val monomorphize_types : bool Term.t
|
|
val dead_value_assignment : bool Term.t
|
|
val no_struct_literals : bool Term.t
|
|
val include_dirs : raw_file list Term.t
|
|
val disable_counterexamples : bool Term.t
|
|
|
|
val extra_files : file list Term.t
|
|
(** for the 'latex' command *)
|
|
|
|
val lcalc : bool Term.t
|
|
(** for the 'interpret' command *)
|
|
|
|
val extension : string list Term.t
|
|
(** for the 'depends' command *)
|
|
|
|
val prefix : string option Term.t
|
|
(** for the 'depends' command *)
|
|
end
|
|
|
|
(** {2 Command-line application} *)
|
|
|
|
val version : string
|
|
val info : Cmdliner.Cmd.info
|
|
|
|
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) *)
|
|
|
|
(** {2 Other helpers} *)
|
|
|
|
val exec_dir : file
|
|
(** Returns the directory of the currently running executable *)
|