package catala
Install
dune-project
Dependency
Authors
Maintainers
Sources
md5=ec7dda88c5f7f371d2a35874cdae2a10
sha512=7cedccfbe5330992d5730441d6ba7b97446237ff5bb4579498a167f2319ec03e8fae50b7f80e3abe96833744b61ffd10719ce0c3e4c144893a4b7adc77e91b56
doc/catala.scalc/Scalc/From_lcalc/index.html
Module Scalc.From_lcalcSource
type translation_config = {keep_special_ops : bool;(*When
*)keep_special_opsis true, then this translation uses special Scalc AST nodes for higher-order operators like map, fold, handle_default, etc. This is useful if the target language after Scalc does not support nested functions like C.dead_value_assignment : bool;(*When
*)dead_value_assignmentis true, the translation inserts dummy assignments of the variable being defined in the current code branch just before raising a terminal error. This is useful for languages like Python and their linting tools like mypy. The assignment uses the polymorphicAst.dead_value.no_struct_literals : bool;(*When
*)no_struct_literalsis true, the translation inserts a temporary variable to hold the initialization of struct literals. This matches what C89 expects.keep_module_names : bool;(*Without this flag, references to modules are expected to be variables defined in the preamble of the output. If set, module names are immutable and must be used as is in all references.
*)renaming_context : Shared_ast.Renaming.context;
}val translate_program :
config:translation_config ->
Shared_ast.typed Lcalc.Ast.program ->
Ast.program