catala/french_law
Louis Gesbert 2003566867 Force parens in compound logic formulas
Closes #373

This forbids expressions such as `a and b or c`, avoiding the need to set an
implicit priority between `and`, `or` and `xor`, which I find error-prone.

Instead, when that appears, a message asking for explicit parentheses will be
shown to the user.

Implementation note: since that would be extremely tedious to do in the parser
directly, the parser is set to allow right-associativity without discrimination
for the logical operators, and the check is done during desugaring. This
required to explicit parentheses in the surface AST to discriminate the case
where the priority was explicit.
2023-01-04 10:46:14 +01:00
..
catala_legifrance Tweak error message location printing 2022-11-28 16:38:09 +01:00
js Force parens in compound logic formulas 2023-01-04 10:46:14 +01:00
ocaml Force parens in compound logic formulas 2023-01-04 10:46:14 +01:00
python Force parens in compound logic formulas 2023-01-04 10:46:14 +01:00
README.md feat(runtime): clean parse_raw_events + add documentation 2022-06-16 11:39:37 +02:00

French Law Libraries

This folder presents a working example of how Catala could be distributed and deployed inside existing applications. Each sub-folder is specialized for a particular programming language, and features a ready-to-use library of all the French public algorithms coded up using Catala so far.

General principles

Let us say you want to deploy a Catala program inside an application written in programming language X. The Catala compiler will translate the source Catala program into X, yielding a new .x source code file. This .x file will export functions corresponding to the scopes of the original Catala program. You can then reuse those exported functions in your application written in X.

OCaml

To see how to deploy Catala programs as an OCaml library, see the dedicated readme.

JS

To see how to deploy Catala programs as a JS library, see the dedicated readme.

Python

To see how to deploy Catala programs as a Python library, see the dedicated readme.