Commit Graph

4121 Commits

Author SHA1 Message Date
Louis Gesbert
7951661981 Turn subscope-vars into scope vars
They are to become citizens of the same class if we want to allow
output-subscopes (without unnecessary complications like deconstructing and
reconstructing the same structure). And it's reasonable to assume that they
share the same namespace.

With this we should shortly collapse the (internal) ambiguity between

- `subscope.subvar`: access to a variable within a subscope
- `subscope.subfield`: access to a field of the output structure contained in a
  subscope variable

With the subscope a variable, these should now become strictly equivalent, so
the plan is that the first could be removed.
2024-04-04 10:24:18 +02:00
Louis Gesbert
eeaadef27c Output subscopes: implement syntax
required a little generalisation and explicit parsing errors to avoid conflicts,
but it remains reasonable
2024-04-04 10:24:18 +02:00
Louis Gesbert
36eca9bf29
Temporary: switch to unreleased version of dates_calc to avoid str dep (#595) 2024-03-27 15:00:39 +01:00
Louis Gesbert
6ce9a6542e CI: disable attempting to build the rescript bindings
Temporarily until we can find how to fix it on Github. At the moment the error
is impossible to reproduce locally...

All the rest from french-law is still tested (wrappers and benches in OCaml, js
and python)
2024-03-27 14:22:14 +01:00
Louis Gesbert
391ecb679c Temporary: switch to unreleased version of dates_calc to avoid str dep 2024-03-26 15:54:29 +01:00
Louis Gesbert
60b2e6f205
Some tweaks helping with separate compilation of the examples (#586) 2024-03-25 16:54:10 +01:00
Louis Gesbert
c85e665650 CI: adjust script for new make rules & artifacts 2024-03-20 16:40:04 +01:00
Louis Gesbert
c9dca1fc6d Fix multi-repo compilation and the 'make alltest' target 2024-03-20 14:41:10 +01:00
Louis Gesbert
adaaf735e6 'catala depends': allow multiple extensions 2024-03-20 14:41:10 +01:00
Louis Gesbert
619cafebb8 Reformat 2024-03-20 14:41:06 +01:00
Louis Gesbert
1a17098297 Move file functions that were in Cli to File
it's now possible because Globals where moved away
2024-03-19 15:26:32 +01:00
Louis Gesbert
0908ed85c3 Clerk: generate all .mli files as well 2024-03-19 15:26:32 +01:00
Louis Gesbert
36c8a7effc Sort strings in natural order when they contain numbers
Seeing results sorted as 1 10 11 2 doesn't look nice.
2024-03-19 15:26:32 +01:00
Louis Gesbert
4cec981f62 Move global options of Cli to their own module
This resolves a dependency cycle that would forbid `Cli` from using the modue
`File`, which was annoying.
2024-03-19 15:18:35 +01:00
Louis Gesbert
77ba1b8b38 Clerk: split OCaml compiler & link rules
and fix call to `catala depends` for OCaml linking
2024-03-14 14:04:52 +01:00
Louis Gesbert
3c03da4a50 file.ml: add a function to cleanup relative paths 2024-03-14 14:04:52 +01:00
Louis Gesbert
99004ab1d9 catala depends fixes
- automatically include the directories of listed files
- work for files that don't define modules
2024-03-13 18:15:50 +01:00
Louis Gesbert
21a429bfcf Jsoo runtime: fix over-wrapping of event manager callbacks 2024-03-12 16:05:38 +01:00
Louis Gesbert
959a49ee92 Jsoo runtime: expose the event manager to JS 2024-03-12 16:04:59 +01:00
Louis Gesbert
9bf441ae31 'catala depends': allow specifying multiple files
The return is a topological order over their joint dependencies.
NOTE: the specified files are now included in the returns
2024-03-12 16:04:59 +01:00
Louis Gesbert
dc6bfae75c Fixes for linking modules in the backends (in particular, Python) 2024-03-08 17:36:00 +01:00
Louis Gesbert
26c28bbd35 Fix line overflow message, and line offset errors 2024-03-08 17:36:00 +01:00
Louis Gesbert
95e3c4bedd Ensure we create the necessary target directories before opening output files 2024-03-08 17:36:00 +01:00
Louis Gesbert
e68e1244a5 Fix complexity of some string functions 2024-03-08 17:36:00 +01:00
Louis Gesbert
ff06ddf40c Fixing linking across modules for backends
- This adds a `catala depends` command that recursively tracks module dependency.
It can then be used by Clerk for linking.

- Generation of cmo object files are added for OCaml (we only built native
objects, but jsoo requires bytecode).

- Some fixes to the generation of value embed/deembed shims (related to types
coming from different modules ; add support for options ; etc.)
2024-03-08 17:36:00 +01:00
Louis Gesbert
70cbfdb9ac Add a CATALA_INCLUDE env variable
It'll help while we wait for the implementation of project-wide specifications.
2024-03-08 17:36:00 +01:00
Louis Gesbert
bc3add57ec Fix plugins lookup dir when Catala is installed to PATH 2024-03-08 17:36:00 +01:00
Louis Gesbert
346f401523 Disambiguate enum constructors from current module in priority 2024-03-08 17:36:00 +01:00
Louis Gesbert
c5b09d55b4 OCaml runtime: expose the dates_rounding type for direct access from the backend 2024-03-08 17:36:00 +01:00
Louis Gesbert
05625daf0e
Repair the 'explain' plugin (#588) 2024-03-05 11:14:03 +01:00
Louis Gesbert
8b3d7fb64b Repair the 'explain' plugin 2024-03-05 10:07:25 +01:00
Denis Merigoux
db508a006a
Fix R compilation (#587) 2024-03-04 14:01:02 +01:00
Denis Merigoux
c2c46c431e
Adress @altgr's suggestion 2024-03-04 13:30:25 +01:00
Denis Merigoux
ad5dd6f2f6 Fix R compilation 2024-03-03 18:36:50 +01:00
Louis Gesbert
eac5f1271c
Support externals in scalc, correctly output them in Python (#584) 2024-02-27 11:41:28 +01:00
Louis Gesbert
c1cd32a8f8 Clerk: skip unchanged tests when running with '--test-flags'
To avoid duplicating runs of identical tests: other tests are unaffected by the
flags.

Also tweak the Makefile to avoid multiple dune runs
2024-02-26 14:56:43 +01:00
Louis Gesbert
b43cc04e16 Clerk tests: use separate dirs for different flags, to preserve caching
The default output remains at the top of _build if no specific flags have been
given, the others are in `_build/test<flags>`
2024-02-26 14:56:43 +01:00
Louis Gesbert
1ea77201ff Lcalc interpreter: fix passing of context arguments 2024-02-26 14:56:43 +01:00
Louis Gesbert
07b71656e7 Native/interpreter interface: handle option types 2024-02-26 14:56:43 +01:00
Louis Gesbert
ba9fc85b84 Make exception output consistent across the interpreters 2024-02-26 14:56:43 +01:00
Louis Gesbert
20c1dee5cb Tests: add catala test-scope pseudo-command for inline tests 2024-02-26 14:56:43 +01:00
Louis Gesbert
4a049080a4 CLI: replace interpret_lcalc by interpret --lcalc
This will make it easier when running tests to just toggle the different flags
2024-02-26 14:56:43 +01:00
Louis Gesbert
97ae62384e Add externals to scalc, working test with Python backend 2024-02-26 14:56:43 +01:00
Louis Gesbert
589833bca7 Make plugin load failures less verbose
In general you don't care unless you may have attempted to use one.
2024-02-26 14:56:43 +01:00
Louis Gesbert
c78a6b62c9
Small ocaml/js output rehaul (#582) 2024-02-22 12:15:31 +01:00
Louis Gesbert
cafad727fe Update the generation process of the website assets
Now they're more simply bundled into a `tar` file generated from the `Makefile`.
2024-02-21 11:28:56 +01:00
Louis Gesbert
e0928677b1 Small ocaml/js output rehaul
Print to json directly rather than depend on yojson and a ppx.

Note: this should be tested with the website in order to validate that the Json
output is 1-to-1.
(a second step could be to simplify this output, now that it's manual)
2024-02-21 11:28:56 +01:00
Louis Gesbert
98ad084062 Clerk: add python targets 2024-02-19 10:44:20 +01:00
Louis Gesbert
4ee4992b54 Tweak multi-module LaTeX output 2024-02-16 16:36:15 +01:00
Louis Gesbert
f09edf443e Fix typo 2024-02-16 16:12:35 +01:00