Commit Graph

2868 Commits

Author SHA1 Message Date
Raphaël Monat
1e0eddfa1f Update syntax 2023-03-16 17:20:13 +01:00
Raphaël Monat
ce858a74df Update syntax cheatsheet 2023-03-16 17:20:13 +01:00
Raphaël Monat
5cf6bdffb8 Add tests for date rounding option 2023-03-16 17:20:13 +01:00
Raphaël Monat
a09b4b82fd Updating french_law 2023-03-16 17:20:13 +01:00
Raphaël Monat
30c6f8e321 Change age check scope names 2023-03-16 17:20:13 +01:00
Raphaël Monat
64fa32392f Update generated files 2023-03-16 17:20:09 +01:00
Raphaël Monat
5fc1e8e5d5 Fix operator printing 2023-03-16 16:55:55 +01:00
Raphaël Monat
6dac7007f2 Tentative CI fix 2023-03-16 16:55:55 +01:00
Raphaël Monat
7021c41f93 Add date rounding option within scopes 2023-03-16 16:55:55 +01:00
Denis Merigoux
7f83a99daa
French law JS must be created with a dune release profile (#429) 2023-03-14 14:11:49 +01:00
Louis Gesbert
7914d9aaef Build: enforce "release" profile for website-assets
but make sure to keep a consistent dune profile otherwise for `make all`,
avoiding multiple rebuilds.

This saves 30s CPU time on a `make all` that doesn't specify
`DUNE_PROFILE=release`
2023-03-14 13:49:50 +01:00
Denis Merigoux
283d82bfce
French law JS must be created with a dune release profile 2023-03-14 11:53:27 +01:00
Denis Merigoux
43ad27037a
Embed the Pygments lexers in Catala (#428) 2023-03-14 10:25:52 +01:00
Louis Gesbert
f1e44619e0 LaTeX literate output: handle pygments coloration from within Catala
This leverages the embedded lexer already used for HTML output, and uses the
LaTeX pygments backend to colorise code directly, without the need for `minted`.
2023-03-13 22:33:48 +01:00
Louis Gesbert
5282aec400 LaTeX output: start refactor 2023-03-13 14:44:34 +01:00
Louis Gesbert
508992de33 Embed the Pygments Catala lexer
This enables the HTML output to work without a custom Pygments installation (or
the proper venv activated)
2023-03-13 14:41:24 +01:00
Louis Gesbert
b75910d087
fix(runtimes/ocaml): rename fun_call.inputs into fun_call.fun_inputs (#427) 2023-03-13 10:51:58 +01:00
adelaett
907244362d Update lock files 2023-03-13 00:23:53 +00:00
Emile Rolley
b2383d33bc fix(runtimes/ocaml): rename fun_call.inputs into fun_call.fun_inputs 2023-03-11 17:37:24 +01:00
Louis Gesbert
97b4ec8a6a CI: fix generation of manpage artifacts 2023-03-10 17:42:48 +01:00
Louis Gesbert
2a482c92fc
Fix colors in HTML literal output, add some HTML docs to the artifacts (#426) 2023-03-10 17:13:21 +01:00
Louis Gesbert
e7f44d71fe Update install instructions
* mention the need for Python venv
* it's no longer true that Catala isn't released on opam
* website assets should be generated in release mode (this affects js
  minification, among other things)
* cleanup stale API docs during `rsync`
2023-03-09 18:55:24 +01:00
Louis Gesbert
c054aa89c9 Add the HTML manpages to the artifacts 2023-03-09 16:27:04 +01:00
Louis Gesbert
16e72f0ba5 README: add note on nightly artifacts 2023-03-09 16:07:36 +01:00
Louis Gesbert
37d9a6cefd Add the HTML tutorials to the published artifacts 2023-03-09 15:47:41 +01:00
Louis Gesbert
e1fe37ad09 Fix coloration in HTML output 2023-03-09 15:46:00 +01:00
Louis Gesbert
e4408b1ba1
Prepare release 0.8.0 (#425) 2023-03-09 09:04:56 +01:00
Louis Gesbert
deb12d2c4a Bump version to 0.8.0
Changelog:
---

A lot has been going on, with more than 530 patches and 70 PRs merged since
0.7.0 last summer. In summary:

- Quite a lot of syntax improvements and changes. Checkout the latest
  [cheat-sheet](https://catalalang.github.io/catala/syntax.pdf) for an overview

- Allow local `let ... equals ... in ...` definitions

- Better error messages and positions throughout

- Added the ability to directly call a scope and retrieve its outputs, like a
  function

- Added disambiguation, allowing to access structure fields without specifying
  the structure type each time

- Added automated resolution of operators, allowing e.g. to write just `+` in
  place of all the type-specific operators `+.`, `+$`, `+@`, `+^`, etc.

- More consistent priority for operators. It is no longer allowed to write `a
  and b or c` without parenthesis.

- Added and changed some operators (`date + duration` now allowed either way,
  `int / int` now returns a decimal, added `duration / duration`)

- Added the ability to have variables and functions defined at
  top-level (outside of any scope). See annex A of the tutorial for details.

- Added support for functions with multiple arguments

- Some big refactors in the compiler, allowing much better code sharing between
  the different passes, and making it much easier to extend. Also added the
  possibility to run the type-checker earlier, etc.

- Countless bug-fixes

- Improvements to our proof backend with Z3

- A tool to automatically synchronise with the upstream French law from
  Legifrance
2023-03-08 18:07:53 +01:00
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