Skip to content

Commit

Permalink
Applications (#246)
Browse files Browse the repository at this point in the history
  • Loading branch information
david-michel1 authored Oct 29, 2024
2 parents c3e907e + 2342bbf commit 44dfb1b
Show file tree
Hide file tree
Showing 12 changed files with 546 additions and 408 deletions.
2 changes: 1 addition & 1 deletion makefiles/c_backend.mk
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ DGFIP_TARGET_FLAGS?=-g,-O,-k4
# -m : millésime de calculette compilé (année des revenus taxés)
# -X : génération de fonctions d'extraction globale dans l'interface,
# bouclant sur la table des variables restituables (IN_init_extraction).
DGFIP_COMMON_FLAGS=-Ailiad,-m$(YEAR),-X
DGFIP_COMMON_FLAGS=-m$(YEAR),-X

MLANG_DGFIP=$(MLANG_BIN) $(MLANG_DEFAULT_OPTS) $(MLANG_DGFIP_C_OPTS)

Expand Down
1 change: 1 addition & 0 deletions makefiles/variables.mk
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ MLANG_BIN=dune exec $(ROOT_DIR)/_build/default/src/main.exe --

PRECISION?=double
MLANG_DEFAULT_OPTS=\
-A iliad\
--display_time --debug\
--precision $(PRECISION)

Expand Down
10 changes: 6 additions & 4 deletions src/mlang/backend_compilers/dgfip_gen_files.ml
Original file line number Diff line number Diff line change
Expand Up @@ -953,10 +953,12 @@ let get_rules_verif_etc prog =
| Rule r ->
let rules, chainings =
if is_valid_app r.rule_apps then
( Pos.unmark r.rule_number :: rules,
match r.rule_chaining with
| None -> chainings
| Some cn -> StrSet.add (Pos.unmark cn) chainings )
let rules = Pos.unmark r.rule_number :: rules in
let chainings =
let fold ch _ chainings = StrSet.add ch chainings in
StrMap.fold fold r.rule_chainings chainings
in
(rules, chainings)
else (rules, chainings)
in
(rules, verifs, errors, chainings)
Expand Down
28 changes: 15 additions & 13 deletions src/mlang/driver.ml
Original file line number Diff line number Diff line change
Expand Up @@ -72,16 +72,16 @@ let patch_rule_1 (backend : string option) (dgfip_flags : Dgfip_options.flags)

(** Entry function for the executable. Returns a negative number in case of
error. *)
let driver (files : string list) (without_dgfip_m : bool) (debug : bool)
(var_info_debug : string list) (display_time : bool)
(dep_graph_file : string) (print_cycles : bool) (backend : string option)
(output : string option) (run_all_tests : string option)
(dgfip_test_filter : bool) (run_test : string option)
(mpp_function : string) (optimize_unsafe_float : bool)
(precision : string option) (roundops : string option)
(comparison_error_margin : float option) (income_year : int option)
(m_clean_calls : bool) (dgfip_options : string list option) =
let dgfip_flags = process_dgfip_options backend dgfip_options in
let driver (files : string list) (application_names : string list)
(without_dgfip_m : bool) (debug : bool) (var_info_debug : string list)
(display_time : bool) (dep_graph_file : string) (print_cycles : bool)
(backend : string option) (output : string option)
(run_all_tests : string option) (dgfip_test_filter : bool)
(run_test : string option) (mpp_function : string)
(optimize_unsafe_float : bool) (precision : string option)
(roundops : string option) (comparison_error_margin : float option)
(income_year : int option) (m_clean_calls : bool)
(dgfip_options : string list option) =
if income_year = None then
Errors.raise_error "income year missing (--income-year YEAR)";
let value_sort =
Expand Down Expand Up @@ -127,9 +127,11 @@ let driver (files : string list) (without_dgfip_m : bool) (debug : bool)
Errors.raise_error
(Format.asprintf "Unkown roundops option: %s" roundops)
in
Cli.set_all_arg_refs files without_dgfip_m debug var_info_debug display_time
dep_graph_file print_cycles output optimize_unsafe_float m_clean_calls
comparison_error_margin income_year value_sort round_ops;
Cli.set_all_arg_refs files application_names without_dgfip_m debug
var_info_debug display_time dep_graph_file print_cycles output
optimize_unsafe_float m_clean_calls comparison_error_margin income_year
value_sort round_ops;
let dgfip_flags = process_dgfip_options backend dgfip_options in
try
Cli.debug_print "Reading M files...";
let current_progress, finish = Cli.create_progress_bar "Parsing" in
Expand Down
Loading

0 comments on commit 44dfb1b

Please sign in to comment.