Commit Graph

2840 Commits

Author SHA1 Message Date
Louis Gesbert
88406072bb
Some small fixes, error message improvements, CI artifacts cleanup (#424) 2023-03-08 18:04:11 +01:00
Louis Gesbert
67ed7447b5 Cleanup the generated artifacts 2023-03-08 15:27:49 +01:00
Louis Gesbert
6388a4b79f Improved some error messages (cyclic defs, def positions) 2023-03-08 15:27:48 +01:00
Louis Gesbert
188a186735 Parser: make state rule syntax consistent with state definitions
Previously the `state` marker for rules was in a weird position:
```catala
rule foo under condition bar
  consequence state st fulfilled
```

This patch unifies the syntax with definitions, now using instead:
```catala
rule foo state st
  under condition bar
  consequence fulfilled.
```
2023-03-08 15:17:58 +01:00
Louis Gesbert
42b8adb968 Add a duration / duration overload
Interstingly enough, it was already implemented in the Python backend.

Required to implement *pro rata temporis*, which the US tax section 121 does
make use of.

Only allowed for durations expressed in days (as returned by `<date> - <date>`),
of course.
2023-03-08 15:17:58 +01:00
Louis Gesbert
56ac72f57e
Fix French syntax highlighting for "résultat" (#421) 2023-03-06 15:36:44 +01:00
Louis Gesbert
27fc786d20
Fix non-transitive comparison function on desugared vars (#422) 2023-03-06 10:07:22 +01:00
adelaett
37639754b6 Update lock files 2023-03-06 00:24:48 +00:00
Denis Merigoux
1fe3987168
Formatting 2023-03-05 12:10:04 +01:00
Louis Gesbert
5398b1037f Fix ill-funded order function on desugared vars 2023-03-03 19:22:17 +01:00
Denis Merigoux
f9e6542d8d
Fix French syntax hilighting for "résultat" 2023-03-03 15:26:59 +01:00
Denis Merigoux
81487bc9f0
update nix files (#420) 2023-03-03 15:08:56 +01:00
adelaett
c680b932ff update nix files 2023-03-03 14:51:51 +01:00
Denis Merigoux
74175907ca
Adelaett fix arrowlist (#409) 2023-03-03 14:04:04 +01:00
Louis Gesbert
57e29f60bd
Refactor Python dep handling + update cheat-sheet (#419) 2023-03-03 11:05:56 +01:00
Louis Gesbert
5e063dac1b
Require argument name declarations, support multiple function arguments everywhere (#413) 2023-03-02 22:37:21 +01:00
Louis Gesbert
97e0cfca6f Improvements on function arguments refactoring
- simplify naming in the french law examples
- make messages yet more precise on function arguments mismatch
2023-03-02 19:11:21 +01:00
Denis Merigoux
9ac85c8e86
Remplace la double préposition « de de » par « de » (#416) 2023-03-02 17:37:30 +01:00
Louis Gesbert
a3b9045745 Update the cheat-sheet
- Add the new syntax for multi-argument functions
- Add the syntax for defining top-level values
- Increased font size and improved compacity
2023-03-02 17:00:14 +01:00
Louis Gesbert
2d0019101a Makefile: add shortcut to build the cheat-sheet
useful to avoid having to manually activate the python venv
2023-03-02 16:24:53 +01:00
Louis Gesbert
cf2e80ba51 Refactor Python dependency handling
* Use the newer "pyproject.toml" for syntax highlighters
* Use venv for everything (previously, the pygment lexers were installed
  globally, but more recent Python releases frown upon that. This will probably
  be more stable in the long run...)
* Use one venv at the root of the project (`_python_venv/`) for both
  pygments and the runtime
* Initialise this venv automatically from the Makefile (it should no longer be
  necessary to run scattered `set_up.sh` scripts with mysterious interactions)

On the downsides, though:
* Only tested with Python 3.11 at the moment
* Need to remember to activate the venv (`. _python_venv/bin/activate`) from the
  root for e.g. HTML literate output to work. A more manageable solution could
  be for Catala to provide the lexers on-the-fly when calling `pygmentize`.
2023-03-02 16:24:53 +01:00
Louis Gesbert
3b2019f0c3 CI: build the documentation & cheat-sheet together with the artifacts 2023-03-02 14:32:07 +01:00
Louis Gesbert
84e6c70d66 Tutorial: fix overfull hbox 2023-03-02 14:32:07 +01:00
Louis Gesbert
52eeae3319 Syntax cheat-sheet: permutation of columns 2023-03-02 14:32:07 +01:00
Louis Gesbert
0aa9e0b130 CI: some more small artifact tweaks 2023-03-01 13:51:07 +01:00
Louis Gesbert
d5c68bb9df Fix CI artifacts page 2023-03-01 12:25:13 +01:00
Louis Gesbert
49c17ab574
CI updates (#418) 2023-03-01 11:47:41 +01:00
Louis Gesbert
97529e97ff CI: add artifacts index 2023-03-01 10:39:11 +01:00
Louis Gesbert
9c54a22082
CI: fix another rebuild (#417) 2023-03-01 09:53:07 +01:00
Louis Gesbert
223457fbf9 Gah there was another one
Don't put 'opam update' in the builds. Update the Docker images if needed.
2023-02-28 22:28:26 +01:00
armand
9c176256fe Remplace la double préposition « de de » par « de » 2023-02-28 21:01:35 +01:00
Louis Gesbert
06cec3baad
CI: attempt some improvements (#415) 2023-02-28 18:51:41 +01:00
Louis Gesbert
4f36430630 CI: don't rebuild everything twice
Reverts 051a64c4b1

Gasp, I only now noticed this; it should absolutely be avoided, in general (the
Docker image is expected to contain a recent repo), and in particular after
switch creation.

Switch to a newer image instead (or just remove the date constraint in FROM but
stable builds are good).
2023-02-28 18:20:47 +01:00
Louis Gesbert
0448c991d2 CI: fix publish-artifacts action 2023-02-28 18:13:01 +01:00
Louis Gesbert
b9405ef5b8
CI improvements attempt (#414) 2023-02-28 17:56:20 +01:00
Louis Gesbert
c393dfb75e CI improvements attempt
- fix dune compilation options: ensure both no dev failure on warnings and CI
  failure on warnings (the defaults do neither of those things !)

- attempt to publish the build artifacts to github-pages, so that they could be
  made more easily available and we could maybe remove the ones that are still
  there from the main repo
2023-02-28 17:55:34 +01:00
Louis Gesbert
3766e9db2c Fix function argument naming consistency in the examples 2023-02-28 16:17:19 +01:00
Louis Gesbert
fc5910e093 Fix multi-argument scopedefs, improve error message positions
This adds a few positions to the parser, and tweaks some others, vastly
improving the reporting of some errors (inconsistent functions definitions, but
also exceptions cycles, etc.)
2023-02-28 15:53:50 +01:00
Louis Gesbert
2c97d5de14 Enforce consistency of function arguments naming 2023-02-28 15:53:50 +01:00
Louis Gesbert
d3ccfe9b91 Adjust examples for the new function declaration syntax 2023-02-28 15:53:50 +01:00
Louis Gesbert
8200457e43 Syntax change: require declaration of function argument names 2023-02-28 15:53:50 +01:00
Louis Gesbert
6b44d19919 Tests: add function parameter inconsistency checks 2023-02-28 15:53:50 +01:00
adelaett
290e67ea7e adding the parsing code to the CI. 2023-02-28 15:23:19 +01:00
adelaett
b9e2c6cf98 Update lock files 2023-02-27 10:19:18 +00:00
Denis Merigoux
d9088d2b66
Fix flake update mechanism (#408) 2023-02-27 09:17:02 +01:00
Denis Merigoux
82141335c7
Tutorial: add top-level value definitions as an annex (#406) 2023-02-27 09:13:27 +01:00
Denis Merigoux
7801b57019
Update Makefile.common.mk (#407) 2023-02-27 09:10:45 +01:00
adelaett
7d50d89f7a nix build now uses cache 2023-02-24 19:38:50 +01:00
armandsalek
ddb8361895
Merge branch 'CatalaLang:master' into master 2023-02-24 17:11:49 +01:00
adelaett
93aa6f0922 update CI to run catala's tests 2023-02-24 15:16:23 +01:00