Commit Graph

600 Commits

Author SHA1 Message Date
Denis Merigoux
2b6687fc44
FIx one of the tests 2023-01-13 16:15:11 +01:00
Denis Merigoux
9557e571d4
Todo list for Justine 2023-01-13 16:15:00 +01:00
Denis Merigoux
5d8c744e7f
Progress with Justine on overseas 2023-01-13 16:14:48 +01:00
Denis Merigoux
ab725ae6cb
Merge branch 'master' into aides_logement_outre_mer 2023-01-13 13:41:23 +01:00
Denis Merigoux
f4c92530c6
Update aides_logement and fix bugs to produce an updated working simulator (#377) 2023-01-13 12:05:32 +01:00
JusBanuls
6d05b2148e Retour à la ligne avec Alain 2023-01-12 17:14:35 +01:00
Denis Merigoux
defe6a82a3
Début implémentation outre-mer avec Justine 2023-01-10 16:13:05 +01:00
Denis Merigoux
c81c5c6708
Small bug spotted with the help of Justine 2023-01-10 11:55:23 +01:00
Denis Merigoux
d86eb8cb03
Ajout revalorisation plafond ASPA 2023 2023-01-10 11:47:14 +01:00
Denis Merigoux
bed7617581
Update smic 2023-01-07 20:53:05 +01:00
Denis Merigoux
fa84dd4330
Splitting long lines 2023-01-05 16:20:51 +01:00
Denis Merigoux
27cf705441
Update article 18 2023-01-04 16:30:14 +01:00
Denis Merigoux
b0e7e9faf8
Update art 15 2023-01-04 16:30:14 +01:00
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
Louis Gesbert
92e925ace8
Syntax changes (#368) 2022-12-20 16:31:50 +01:00
Louis Gesbert
47502335aa Refactor the parser to use priorities
Define a single expression rule with disambiguation using token priorities
instead of the many layers of intermediate rules with explicit sub-terms.

Also replaces `in` for collection operations (`x+1 for foo in [1;2]`) with
`among` which helps a lot.
2022-12-19 15:12:53 +01:00
Matthew Gerrior
a58d98bce5
Fix typo in tutorial_en.catala_en
When working through the tutorial, I was thrown off a bit by this minor typo. The typo made it look like the tax calculation was subtracting the $10,000 exception from above, as opposed to the $100,000 from the bracket.
2022-12-18 15:38:19 -05:00
Louis Gesbert
f236e2cfb2 Replace the type conversion and rounding operators with overloads
Ref. #366

Also updates `CONTRIBUTING.md`.

This was pretty straight-forward :)
2022-12-13 15:32:49 +01:00
Louis Gesbert
c94509e0bb Remove integer division from the language
it's unlikely to be used in any law, and likely to be cause for confusion.

best of all, the new operator has a different return type, which
ensures no inconsistency with the change can get overlooked.
2022-12-13 12:35:02 +01:00
Louis Gesbert
dcb422302d Tests/examples update 2022-12-13 12:30:40 +01:00
Louis Gesbert
bb58d11ca8 Improve syntax for scope calls
implements #357
2022-12-13 12:30:38 +01:00
Louis Gesbert
09d49ab1cc French syntax: replace 'sortie' with 'résultat'
as per comment in #357
2022-12-13 12:27:33 +01:00
Louis Gesbert
4a66848eb3 Clarify some bits of the overload handling code
and address other remarks from the review of #365
2022-12-13 12:00:05 +01:00
Louis Gesbert
71bb67163c Remove explicitely typed operators in tests and examples
Command used: `sed -i 's/\([-+*/><=]=\?\)[.$@^€$]/\1/g' **/*/*.catala_*`

The overload test, of course, is kept unchanged and ensures that explicit
operators still work.
2022-12-13 12:00:04 +01:00
Louis Gesbert
b4adc33666 Update tutorial for overloads 2022-12-13 11:55:35 +01:00
Louis Gesbert
4ee4a96ac7 Remove *all* struct field access qualifiers in catala code
They are no longer needed \o/
2022-11-28 16:42:02 +01:00
Louis Gesbert
af2f5dbe19 Tweak error message location printing 2022-11-28 16:38:09 +01:00
Denis Merigoux
d7b9396e87
Correct lines 2022-11-24 15:17:00 +01:00
Denis Merigoux
b49e32cb59
Use scope calls in "Aides logement" (#352) 2022-11-07 16:18:03 +01:00
Louis Gesbert
a51d082033 Use scope calls in "Aides logement" 2022-11-07 14:23:10 +01:00
Louis Gesbert
4d4dac6727 Some fancy unicode for error outlines
Normally I would make sure this is not by default, or at leat disableable; but
here the code we print may contain utf8 anyway, so the terminal really needs to
support it. Anyway, it's just a little fancier, doesn't add much.
2022-11-07 14:13:01 +01:00
Louis Gesbert
429911024c Add parseable line-column info to error messages
a quick fix for now, ideally we want an option for editor-friendly output.
But for now this is a very cheap way to at least have clickable error messages
which are a big time-saver.
2022-11-07 14:03:38 +01:00
Louis Gesbert
48d788d744 Add tutorial section about direct scope calls
I am not convinced about this, would there be a better place where to put it?

My worry is that it could get confusing and should not be presented as "another
way to define subscopes", but it ended up a bit verbose.

There is also no section yet on "let-in" definitions, so I did not use them in
the example.
2022-10-25 12:28:51 +02:00
Louis Gesbert
b19a7660fc Fix ambiguities in examples 2022-10-21 17:36:44 +02:00
Louis Gesbert
5fc3181621 Aides logement: fix typo 2022-10-11 17:38:31 +02:00
Louis Gesbert
8c1696d0ff Inline tests: cleanup trailing whitespace 2022-09-23 16:56:21 +02:00
Louis Gesbert
0c0ef1ae1a Add test return codes
Simply re-generated with 'make tests CLERK_OPTS=--reset'
2022-09-23 14:50:02 +02:00
Louis Gesbert
0ab7a0f9ce Turn all existing tests to inline tests
Done using
```bash
process() { FILE=$1; awk 'match($0, /^```catala-test *{ *id *= *"(.*)" *}/, a) {print "```catala-test-inline"; f="'"$(dirname $FILE)/output/$(basename $FILE)"'." a[1]; getline; print "$ " $0; while ((getline<f) > 0) print; next} {print}' $FILE >$FILE.new; mv $FILE.new $FILE; }
for f in tests/test_*/*/*.catala_* examples/**/*.catala_*; do process $f; git add $f; done
for d in $(find -name output -type d); do git rm -r $d; done
```
2022-09-23 14:45:10 +02:00
Denis Merigoux
6e64f769a0
Update assets and rename executable 2022-09-08 15:16:39 +02:00
Denis Merigoux
a4207c9d9e
Last corrections 2022-09-08 14:54:02 +02:00
Denis Merigoux
1df20c18ac
Fixing discrepancies with LegiFrance in French housing benefits 2022-09-08 12:30:16 +02:00
Denis Merigoux
3188ac5e13
Starting to fix diffs 2022-09-07 17:51:48 +02:00
Denis Merigoux
3756a6fb22
Fix french housing benefits 2022-09-07 17:14:36 +02:00
Denis Merigoux
84b994b521
Bug caught with proof mode 2022-09-05 17:35:44 +02:00
Denis Merigoux
6130151c8e
Fix bug and typos 2022-09-05 14:50:37 +02:00
Denis Merigoux
ba20584b06
Mise à jour du calcul des aides au logement suite à revalorisation IRL (#326)
L'[arrêté du 16 août 2022 relatif au calcul des aides personnelles au logement et de l'aide à l'accession sociale et à la sortie de l'insalubrité spécifique à l'outre-mer](https://www.legifrance.gouv.fr/jorf/id/JORFTEXT000046204011) indique une revalorisation de certains paramètres du calcul des aides au logement au 1er juillet 2022. Cette PR reflète les changements dans le code de la calculette Catala des aides au logement, et fait suite à la première partie de la revalorisation (#305).
2022-09-05 14:00:21 +02:00
Denis Merigoux
e37639667d
Mise à jour arrêté du 16 août 2022 2022-09-05 12:15:36 +02:00
Denis Merigoux
6c46574a83
Really fix tests and programs 2022-08-30 14:46:51 +02:00
Denis Merigoux
84e5e6445e
Added test controls 2022-08-30 14:27:25 +02:00
Hugo Gimbert
e0e099c724 Merge remote-tracking branch 'origin/master' into cgr_example 2022-08-30 14:12:57 +02:00
Denis Merigoux
5bddde1c68
Fix documentation and test invocation 2022-08-30 13:48:20 +02:00
Hugo Gimbert
9a17205a2a merged with master 2022-08-30 10:00:14 +02:00
Hugo Gimbert
799b16975d Merge remote-tracking branch 'origin/master' into cgr_example 2022-08-30 09:37:50 +02:00
Hugo Gimbert
a859eeb947 NSW tests ok 2022-08-30 09:16:03 +02:00
Denis Merigoux
1c3d5b9a75
Fix all lines too long problems & update assets 2022-08-29 15:46:06 +02:00
Denis Merigoux
538cca3f0e
Fix table 2022-08-26 12:05:22 +02:00
Denis Merigoux
e41e0f9dcc
Fix line length and display lines of code 2022-08-26 12:05:22 +02:00
Denis Merigoux
062fea89d7
No RLS for logement-foyers 2022-08-19 11:54:15 +02:00
Denis Merigoux
d6ad4604ce
Only social conventions for logement-foyers 2022-08-19 11:39:04 +02:00
Denis Merigoux
1553f88cf5
Remove unnecessary input 2022-08-18 18:53:30 +02:00
Denis Merigoux
2bc1b7d7f7
RLS only for social housing 2022-08-18 16:00:52 +02:00
Denis Merigoux
62ff234319
Shuffle data around 2022-08-18 15:27:01 +02:00
Denis Merigoux
1d63c48b9c
Fix test 2022-08-18 11:55:19 +02:00
Denis Merigoux
331789bfee
Remove input data duplicate 2022-08-16 17:39:18 +02:00
Denis Merigoux
82940b63e3
Remove mode_occupation from AL/APL logement-foyer's input
In favor of a more restricted input
2022-08-16 17:01:53 +02:00
Denis Merigoux
54e08585c6
Put sectorial information where it belongs 2022-08-16 16:22:51 +02:00
Denis Merigoux
92189e6439
Fix bug introduced by a1ebb67 2022-08-16 14:40:12 +02:00
Denis Merigoux
a1ebb6715c
Remove age prompts, deduct from birth date correctly 2022-08-16 11:08:13 +02:00
Denis Merigoux
d93e00c7bc
Some factorization 2022-08-15 18:33:09 +02:00
Denis Merigoux
1fdb21326b
Fix logement meublé thing 2022-08-15 17:43:29 +02:00
Denis Merigoux
489d2f9506
Fixed bugs in allocation logement eligibility 2022-08-15 17:16:23 +02:00
Denis Merigoux
c71b8e28c6
Moving parameters into property-section of data 2022-08-12 11:16:52 +02:00
Denis Merigoux
ef269df553
Restore tests 2022-08-12 09:51:35 +02:00
Denis Merigoux
c062ac2924
Added a new test 2022-08-11 18:18:04 +02:00
Denis Merigoux
9184b1e265
Further use let-in 2022-08-11 18:17:53 +02:00
Denis Merigoux
35a893920b
Précision chambre CROUS 2022-08-11 18:17:33 +02:00
Denis Merigoux
9eef072cdd
Logement à usage locatif s'applique aussi aux logements-foyers 2022-08-11 18:17:00 +02:00
Denis Merigoux
7b7d31d0a5
Fix non-negative value bug in housing benefits 2022-08-11 16:16:00 +02:00
Denis Merigoux
a48e90150c
Use let-bindings to refactor code 2022-08-11 14:12:11 +02:00
Denis Merigoux
038e6068e6
Small improvements to housing benefits 2022-08-10 18:13:07 +02:00
Denis Merigoux
e5d6c26eb4
Merge pull request #303 from CatalaLang/feat-add-details-to-html
Feat: improve the HTML generation with ToC and details tags
2022-08-05 20:42:36 +02:00
Denis Merigoux
d75d86d321
Merge pull request #305 from CatalaLang/aides_logement
Mise à jour du calcul des aides au logement suite à revalorisation
2022-08-05 20:28:13 +02:00
Emile Rolley
03aebf7f1c feat(backends/html): improve the code generation with ToC and details tags 2022-08-05 10:55:45 +02:00
Denis Merigoux
0e2bc96789
Mise à jour du calcul des aides au logement avec https://www.legifrance.gouv.fr/jorf/id/JORFSCTA000046114996 2022-08-04 18:07:29 +02:00
Louis Gesbert
e50b567000 Fix relative dir in french_law artifacts ; add a note in examples/README.md 2022-08-04 17:36:50 +02:00
Louis Gesbert
289975ebe8 Generate french law python artifacts through dune
(they're no longer reformatted, at the moment, though)
2022-08-03 19:04:14 +02:00
Louis Gesbert
9db038812c Include generation of json_schema artifacts
(plus other small Makefile improvements)
2022-08-03 18:55:42 +02:00
Louis Gesbert
0600501ec6 Generate french_law artifacts through dune
The files where manually generated through Makefile rules, and
versionned (with an outdated version).

The issue was that we had:
- `dune` building Catala
- Makefiles calling `catala` to build and copy the `french_law/ocaml/law_source`
  files
- then `dune` again to build `french_law`

The result was that `dune build` (without running `make` first) would
return a weird error.

The proposed solution adds ad-hoc dune rules to call the catala
binary, so that it can handle the whole pipeline correctly. If OCaml
is purely a backend, though, a simpler solution that makes us less
dependent on dune would be to handle the compilation of `french_law`
manually.

The dune rules are set to 'promote' the files so that it preserves the
fact that they are versionned (but with no confusion of the build system
about where they should come from anymore)
2022-08-03 18:55:42 +02:00
Emile Rolley
1a6934b538 feat(build): add the generation of json schemas to the build workflow 2022-07-29 18:47:42 +02:00
Emile Rolley
32ec53d918 refactor(plugins): jsoo -> web 2022-07-29 18:42:41 +02:00
Denis Merigoux
27560b0ab8
Fix conflict 2022-07-28 17:18:41 +02:00
Denis Merigoux
97b6e14740 Removed useless variable 2022-07-28 15:02:43 +02:00
Denis Merigoux
d91ed27e28 The JS version of the housing benefits computation is working! 2022-07-28 15:02:43 +02:00
Denis Merigoux
fa55a83fb4
Merge branch 'master' into 290-jsoo-wrapper-plugin 2022-07-22 17:54:51 +02:00
Denis Merigoux
aa3820c2a7
Nitpicks 2022-07-22 17:42:24 +02:00
Denis Merigoux
4002c22570
Contre-ordre: DGLAN admet l'arrondi par défaut 2022-07-22 17:05:09 +02:00
Emile Rolley
d9045499c0 refactor(french_law/ocaml): refactor the api_web.ml 2022-07-22 17:01:33 +02:00
Denis Merigoux
dc00ce8957
Merge branch 'master' into aides_logement 2022-07-22 16:49:01 +02:00
Denis Merigoux
ad0f02837c
Fix some TODOs 2022-07-21 14:54:05 +02:00
Emile Rolley
61899cd698 fix(examples): assets are now generated from the repo root 2022-07-20 18:29:01 +02:00