Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Intégration des domaines de règles dans le langage M #221

Merged
merged 27 commits into from
Aug 17, 2023

Conversation

david-michel1
Copy link
Collaborator

@david-michel1 david-michel1 commented Jun 21, 2023

Remplacement des tags en domaines de règles et enchaîneurs.

Copy link
Contributor

@denismerigoux denismerigoux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Super ! Ça avance bien et le code me semble aussi bien.


domaine regle corrective base_tl_rect
: calculable;

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok donc le code "hardcodé" est simplement des strings dans ce fichier. Est-ce qu'on pourrait pas aller plus loin et simplement foutre metier.m dans un string à la compilation plutôt que du dupliquer métier.m ? @Keryan-dev il me semble que tu peux faire ça en OCaml avec https://github.com/mirage/ocaml-crunch.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tant que ce contenu est pas dupliqué ça me va en tout cas.

(let filebuf = Lexing.from_string Dgfip_m.declarations in
current_progress "internal DGFiP M";
let filebuf =
{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK ça marche!

|> StrSetMap.add StrSet.empty (get_dom def_id domains)
| None -> Errors.raise_error "there are no default rule domain"
in
(* let _ = let iter id dom = let pp_ss fmt ss = let iter s = Format.fprintf
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code mort ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code de test. Il sert encore parfois.

Copy link
Contributor

@denismerigoux denismerigoux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ça m'a l'air très bien, merci David ! J'ai deux petits commentaires suggérant d'éventuels refactoring mais le code est très lisible et cohérent.

J'imagine que tu as du écrire des documents de spec pour décrire comment marchent tes déclarations de domaines. Est-ce que tu pourrais les rajouter à cette PR, sous forme d'un .md ou dans du ocamldoc?

if pred cv then Mir.CatVarSet.add cv res else res)
p.program_var_categories Mir.CatVarSet.empty
in
match Pos.unmark l with
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Est-ce que ce code n'est pas la même chose que celui dans mast_to_mir.ml, ligne 1573 ? Si oui il faudrait mieux les factoriser en faisant une fonction pour éviter que les deux ne dérivent.

Comment on lines 58 to 60
| DepositDefinedVariables
| TaxbenefitCeiledVariables
| TaxbenefitDefinedVariables
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Est-ce qu'on pourrait pas virer ces trois cas de l'AST puisque maintenant c'est géré par les domaines déclarés ?

@david-michel1 david-michel1 marked this pull request as ready for review August 17, 2023 07:49
@david-michel1 david-michel1 merged commit 98b5ace into master Aug 17, 2023
1 check passed
@david-michel1 david-michel1 deleted the extension_m_metier branch August 17, 2023 07:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants