-
Notifications
You must be signed in to change notification settings - Fork 9
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
Conversation
There was a problem hiding this 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; | ||
|
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
src/mlang/driver.ml
Outdated
(let filebuf = Lexing.from_string Dgfip_m.declarations in | ||
current_progress "internal DGFiP M"; | ||
let filebuf = | ||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK ça marche!
src/mlang/m_frontend/mast_to_mir.ml
Outdated
|> 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code mort ?
There was a problem hiding this comment.
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.
There was a problem hiding this 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 |
There was a problem hiding this comment.
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.
src/mlang/mpp_ir/mpp_ir.ml
Outdated
| DepositDefinedVariables | ||
| TaxbenefitCeiledVariables | ||
| TaxbenefitDefinedVariables |
There was a problem hiding this comment.
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 ?
Remplacement des tags en domaines de règles et enchaîneurs.