Commit Graph

3557 Commits

Author SHA1 Message Date
Louis Gesbert
ce17d8e563 Fix plugins compilation 2023-09-27 13:18:28 +02:00
Louis Gesbert
a0405e31d5 Clerk: cleanup how test diffing/resetting is handled 2023-09-27 13:18:28 +02:00
Louis Gesbert
ade51234e8 Discard catala option --build-dir that is not useful in the end 2023-09-27 13:18:28 +02:00
Louis Gesbert
50fad76df3 Clerk: copy files to _build and run catala there
this is more consistent, avoids empty stamp files and should make things simpler
overall.

The slightly tricky `-C` option is added to Catala so that it can be run from
_build while paths to source and destination files are still specified relative
to CWD (Ninja doesn't provide string manipulation, so otherwise we would have to
explicit both the `_build/dir/` and `dir/` versions of each path).
2023-09-27 13:18:28 +02:00
Louis Gesbert
5efa61a0ce Clerk: rewrite 'clerk runtest' to use the new lightweight lexer
* Obsolete code for included tests has been removed

* The engine uses a proper lexer and is much simplified

* An inline test in the middle of the file now only "sees" the file up to that
  point. This fixes an issue where we had spurious errors when a type error was
  added at the end of a file, and it would pop up in tests before it. This makes
  files including many tests much more practical.

* diffing and resetting the tests has been reintroduced (done at the moment in
  Ninja, but for more control (count number of failed tests, etc.) we could put it
  back into Clerk at some point

* The Catala CLI can now take an input from stdin (with the possibility to link
  a (possibly fake) on-disk file for error reporting and file locations ; this
  is useful for running tests)
2023-09-27 13:18:18 +02:00
Louis Gesbert
cc7066e9a8 Clerk: better handling of transitive dependencies
We need a concrete intermediate target for e.g. transitive uses of `> Include`
for Ninja to correctly handle them.

Of course we could also unroll all transitive dependencies, but meh.

Note also that now tests now just generate the outputs but facilities for
diffing and resetting are temporarily absent.
2023-09-27 13:14:40 +02:00
Louis Gesbert
dbe0990163 Rework module includes CLI in Catala
Rather than require all files to be listed on the command-line (and having to
check consistency with `> Using` directives), the main catala CLI is now a bit
more clever.

⇒ There is a new assumption that a module name definition must match the file
name (up to case and extension) — with appropriate error handling to enforce it.

In exchange, `> Using` directives are now used to more transparently lookup the
appropriate `.catala_*` interfaces and the compiled artifacts for the used modules (handling transitive dependencies), with just standard `-I` flags for when they need to be looked up in different places.
2023-09-27 13:14:40 +02:00
Louis Gesbert
4bce4e6322 Reformat 2023-09-27 13:14:38 +02:00
Louis Gesbert
094c5f94f6 Clerk: add 'clerk build' subcommand
that allows to build arbitrary targets passed through to Ninja
2023-09-27 13:14:08 +02:00
Louis Gesbert
442997aea5 Clerk: rework CLI to use subcommands 2023-09-27 13:14:08 +02:00
Louis Gesbert
f162f6e9bd Improve handling of module name definitions
and add some sanity-checks for consistency of used modules w.r.t. actually
loaded modules.
2023-09-27 13:14:03 +02:00
Louis Gesbert
22c69938b6 Fix handling of "output" tests
I.e. our legacy tests with a separate output tests, to distinguish from inline
tests.
2023-09-27 13:08:15 +02:00
Louis Gesbert
326990678f Enforce recent yojson version
2.0 doesn't need biniou or easy_format anymore
2023-09-27 13:08:15 +02:00
Louis Gesbert
1ee2980ae7 Clerk: enable by-directory test targets 2023-09-27 13:08:15 +02:00
Louis Gesbert
63773e48b5 Update tests outputs 2023-09-27 13:08:15 +02:00
Louis Gesbert
55e8e24cab Clerk: re-enable 'clerk run' 2023-09-27 13:08:15 +02:00
Louis Gesbert
f8e3774662 Fix lookup of built modules in Catala 2023-09-27 13:08:15 +02:00
Louis Gesbert
60fe40e25b Clerk: fix some module linking options 2023-09-27 13:08:15 +02:00
Louis Gesbert
494be673a8 Rehaul the Clerk build system to fully handle modules and linking 2023-09-27 13:08:15 +02:00
Louis Gesbert
8eb254aa32 Rename tests with ambiguous outputs
With modules, it's not reasonable to allow two catala files with the same
basename but different langs
2023-09-27 13:08:15 +02:00
Louis Gesbert
cf8f365cf7 Extract Catala version from dune
(avoids multiple, possibly inconsistent, definitions ; also syncs up Clerk
versions with Catala)
2023-09-27 13:08:15 +02:00
Louis Gesbert
94ec864890 Scan file tree: proceed in sequence 2023-09-27 13:08:15 +02:00
Louis Gesbert
bf048f0a74 Add a lightweight lexer for dependency extraction in Clerk
The base is there but not fully used yet in Clerk
2023-09-27 13:08:15 +02:00
Louis Gesbert
9aed2c7479 support for parsing Module directives 2023-09-27 13:08:11 +02:00
Louis Gesbert
9445f83407
Improve assertion failure message (#518) 2023-09-27 13:07:38 +02:00
Denis Merigoux
ec18ac10bb
Fix missing implem 2023-09-22 18:06:44 +02:00
Denis Merigoux
1f4805caad
Print interpreter error messages with localized expression printer 2023-09-22 18:06:43 +02:00
Denis Merigoux
9cecf5587a
Register surface syntax languge in program troughout the compilation chain 2023-09-22 18:05:26 +02:00
Denis Merigoux
ea838ed6af
Comment 2023-09-22 18:05:26 +02:00
Denis Merigoux
7bad9aa20e
Improve assertion failure message 2023-09-22 18:05:26 +02:00
Denis Merigoux
38782fa546
Correct fix 2023-09-22 18:02:44 +02:00
Denis Merigoux
6356a3c7f8
Fix linebreaking in LaTeX Catala code (#520) 2023-09-22 17:16:48 +02:00
Denis Merigoux
9c83943f2b
Revert "Break lines in code Latex output"
This reverts commit 7971cb7651.
2023-09-21 13:58:26 +02:00
Denis Merigoux
5eba0b6562
Trying 2023-09-21 13:57:54 +02:00
Denis Merigoux
7971cb7651
Break lines in code Latex output 2023-09-21 13:30:30 +02:00
Denis Merigoux
f9768c1813
Optim: avoid extra translations in the interpreter (#519) 2023-09-20 17:34:35 +02:00
Louis Gesbert
c63d74647d Optim: avoid extra translations in the interpreter
A recent patch introduced custom terms in expressions manipulated by the
interpreter. For typing reasons, a traversal is done to extend the supplied
expression with these custom terms — it's functionally the identity, but, due to
the fact that the type-checker can't infer covariance of our AST terms on their
phantom parameter, playing by the rules imposes a full traversal + rebuild.

Without resorting to a (constrained) `Obj.magic`, this patch avoids extra
intermediate conversions, which is enough to cut out the huge extra cost we were
incurring.

Closes #516
2023-09-19 18:22:43 +02:00
Denis Merigoux
a908b2a45c
Mise à jour du calcul des aides au logement avec la réforme des retraites (#515) 2023-09-19 13:58:23 +02:00
Denis Merigoux
da50115acf
Fixes OCaml error not caught in JS (#511) 2023-09-19 13:47:51 +02:00
Denis Merigoux
524c8b1274
Commentaire précis 2023-09-19 13:44:01 +02:00
Denis Merigoux
43a1e30c33
Update old image on main README (fixes #514) 2023-09-19 13:29:14 +02:00
Denis Merigoux
f57127c0aa
Fix anteriority bug 2023-09-19 12:07:02 +02:00
Denis Merigoux
029c555dc6
Mise à jour du calcul des aides au logement avec la réforme des retraites (#506) 2023-09-19 11:56:57 +02:00
armandsalek
ff3060fa04
implémenter calcul de âge_l351_1_5_sécu qui a remplacé âge_l161_17_2_sécu dans le code actuel 2023-09-19 11:55:47 +02:00
Denis Merigoux
a6e15eb150
Mise à jour CCH reglementaire au 2023-09-01
Manque des implémentations de la réforme des retraites
2023-09-19 11:55:31 +02:00
Denis Merigoux
b432bdd700
Extra .gitignore after make all 2023-09-15 10:34:42 +02:00
Denis Merigoux
af1fbe884c
Encapsulate by default all Web API calls with execute_or_throw_error 2023-09-15 10:29:31 +02:00
Louis Gesbert
3cc77f4601
Improvements to the Polish translation (#499) 2023-09-13 16:19:06 +02:00
Louis Gesbert
a89a95ef6a
Remove catala_legifrance (#509) 2023-09-13 16:17:32 +02:00
Denis Merigoux
efd175a390 Remove from scripts 2023-09-13 16:16:48 +02:00