Commit Graph

2354 Commits

Author SHA1 Message Date
Louis Gesbert
7485c7f2ce Reformat 2022-07-11 17:42:34 +02:00
Louis Gesbert
985ecdac6d Bump required OCaml version to 4.13
This version of OCaml introduces [let-punning](https://v2.ocaml.org/manual/bindingops.html#ss:letops-punning)

It is just syntactic sugar, but OCamlformat makes use of it, without a configuration option, when the OCaml version permits.
This means that the same version of OCamlformat gives different results depending on the underlying OCaml version. Our options, if we want to keep the forced-format policy on the repository, are therefore:
- to disable it whenever binding operators are used (with this PR that's a lot of places, and this becomes too cumbersome, besides defeating the purpose)
- to force devs to use an earlier version of OCaml so that reformatting outputs something compatible
- to bump the minimum OCaml requirement

The latter is the simplest, but it can be reviewed if compatibility is required. Last option would be to report the issue to OCamlformat and hope that they provide a workaround...
2022-07-11 17:42:34 +02:00
Louis Gesbert
504f54c31e Rework type error reporting 2022-07-11 17:42:34 +02:00
Louis Gesbert
02fc255177 Typing scopes: bottom-up rather than top-down
it's better for error messages (and similar to how it was done before)
2022-07-11 17:42:34 +02:00
Louis Gesbert
18e86621d5 Port verification code to the AST changes 2022-07-11 17:42:34 +02:00
Louis Gesbert
5f882e35a2 dcalc ast: make the map function more polymorphic 2022-07-11 17:42:34 +02:00
Louis Gesbert
49efb5ddd7 Improve debugging, add backtraces (when recording is enabled) 2022-07-11 17:42:34 +02:00
Louis Gesbert
296a1de7dd Typing: add functions to type scopes without conversion to expr 2022-07-11 17:42:34 +02:00
Louis Gesbert
4eb5933ad0 Porting the interpreter to the marked AST 2022-07-11 17:42:30 +02:00
Denis Merigoux
c5cb6f5c4d
Restore automatic rebuild of all tests by ninja
Also cleaned unused rule arg
2022-07-11 16:56:06 +02:00
Louis Gesbert
6cc2e9a07b typing.ml: fix use of bindlib 2022-07-11 16:51:54 +02:00
Louis Gesbert
67179a793c Add type annotations on all AST nodes (first pass) 2022-07-11 16:51:54 +02:00
Louis Gesbert
513647cd32 AST simplification: remove redundant annotations
The AST structures track annotations (e.g., at the moment, source code
position information) in a lot of places. This patch tidies up a bit and
removes some duplication, ensuring a single level of annotation wrapping
at each AST recursion level.

This will be important when adding type information in these
annotations, because there will be consitency constraints to be ensured
and duplication is a likely source of mistakes.
2022-07-11 16:51:54 +02:00
Louis Gesbert
af0ac95682 Propagate renaming of Pos.mark* into module Marked
this patch is just a bunch of `sed` commands

```shell
cd compiler
sed -i 's/Pos.marked/Marked.pos/g' *.ml* **/*.ml*
sed -i 's/Pos.unmark/Marked.unmark/g' *.ml* **/*.ml*
sed -i 's/Pos\.get_position/Marked.get_mark/g' *.ml* **/*.ml*
sed -i 's/Pos\.same_pos_as/Marked.same_mark_as/g' *.ml* **/*.ml*
sed -i 's/Pos\.map_under_mark/Marked.map_under_mark/g' *.ml* **/*.ml*
sed -i 's/Pos\.mark/Marked.mark/g' *.ml* **/*.ml*
sed -i 's/Pos\.compare_marked/Marked.compare/g' *.ml* **/*.ml*
```
2022-07-11 16:51:54 +02:00
Louis Gesbert
481aea83e0 Generalise the type for AST node markings 2022-07-11 16:51:54 +02:00
Louis Gesbert
d7dbbde26f
Merge pull request #285 from CatalaLang/fix_192
Partially fix #192
2022-07-11 16:43:48 +02:00
Louis Gesbert
d2a182043b Update doc for handling tests 2022-07-11 16:03:47 +02:00
Catala nix updated
2051ea4457 update lock files 2022-07-11 00:23:12 +00:00
Louis Gesbert
1d268a940b Add tests for the examples as well 2022-07-08 17:18:58 +02:00
Louis Gesbert
2e5050481d Register all existing tests through the new engine
I removed the '.out' extension for now to preserve the test output file names and avoid a million file renames.

This makes the patch easier to read, and we can do the rename easily in another patch afterwards, without mixing with semantic changes.

(beautiful script àlarrache:
```bash
for f in */*/output/*; do
  target_base=${f##*/}
  target_base=${target_base%%.*}
  echo $f | awk -F. '{
    f=$1"."$2; if ($4 == "") { mode=$3; id=$3 } else { scope="-s "$3; mode=$4; id=$3"."$4}
    printf "\n```catala-test {id=\"%s\"}\ncatala %s %s\n```\n",id,mode,scope;
  }' >> $(dirname $f)/../${target_base}.*; done
```
2022-07-08 17:06:20 +02:00
Denis Merigoux
66a7d2f7a3 Fix test encoding 2022-07-08 15:37:01 +02:00
Denis Merigoux
fa0d94a2b6
Remove authors feature whose behavior is not satisfactory 2022-07-08 14:41:19 +02:00
Denis Merigoux
a78f649377
Add negative test 2022-07-08 14:16:02 +02:00
Denis Merigoux
bdbf202a8d
Minimal implementation of https://github.com/CatalaLang/catala/issues/192#issuecomment-1178750411 2022-07-08 14:10:25 +02:00
Denis Merigoux
46d2312bb6
Merge pull request #284 from CatalaLang/update-citation
docs: udpate the CITATION file
2022-07-07 16:35:41 +02:00
Emile Rolley
ad20f449d1
docs: update the CITATION file 2022-07-07 16:18:08 +02:00
Emile Rolley
3579bf90b1
docs: udpate the CITATION file 2022-07-07 16:14:56 +02:00
Denis Merigoux
81fe7db311
Implemented better split custody handling that applies correct post-processing steps to the
corrected amount
2022-07-07 15:19:32 +02:00
Denis Merigoux
6987719f3b
Prepping for correct split custody sharing 2022-07-07 15:03:03 +02:00
Denis Merigoux
a34a330dc4
Fix breaklines in LaTeX 2022-07-06 17:37:42 +02:00
Denis Merigoux
fdf9d49b23
Merge pull request #266 from CatalaLang/allocations_logement
Implementation of French housing benefits : 2/N
2022-07-06 17:02:14 +02:00
Denis Merigoux
1a08207680
Restore tests 2022-07-06 16:52:13 +02:00
Denis Merigoux
5e45940e1b
Merge branch 'master' into allocations_logement 2022-07-06 16:43:14 +02:00
Denis Merigoux
9cdeb907f5
Fix missing age of L841-1 2022-07-06 15:37:23 +02:00
Denis Merigoux
b1dd3a822e
We now compute the split custody! 2022-07-06 15:25:31 +02:00
Denis Merigoux
443a4bbc1d
Restore test 2022-07-06 14:46:25 +02:00
Denis Merigoux
cd6840fdcb
Prepping for split custody 2022-07-06 12:52:03 +02:00
Denis Merigoux
cfe9f0ca28
Added a global "calculette" tested with a dummy example 2022-07-06 12:24:45 +02:00
Denis Merigoux
0ab22dfee8
Fix sign bugs 2022-07-05 16:17:26 +02:00
Denis Merigoux
ea6083d5a2
Disable optimisations for french_law.js because of #274 2022-07-04 12:14:21 +02:00
Denis Merigoux
07b348a309
Update assets 2022-07-04 12:08:54 +02:00
Catala nix updated
feff9ecd74 update lock files 2022-07-04 00:26:59 +00:00
Catala nix updated
1723f7c6fa update lock files 2022-06-27 00:24:59 +00:00
Denis Merigoux
ccaf77edaa
Merge pull request #283 from CatalaLang/remove-unembedable-from-events
refactor(runtime): ignore function definition while parsing raw events
2022-06-24 11:03:49 +02:00
Emile Rolley
97cf14b3f5 refactor(runtime): ignore function definition while parsing raw events 2022-06-23 17:35:11 +02:00
Denis Merigoux
541f014396
Correct hierarchy in family benefits epilogue 2022-06-23 10:05:24 +02:00
Denis Merigoux
29b736ec4f
Merge branch 'allocations_logement' of github.com:CatalaLang/catala into allocations_logement 2022-06-23 10:03:54 +02:00
Denis Merigoux
94cf874eb1
Merge pull request #280 from CatalaLang/specify-logs-struct
Refactor(runtime/api_web): parse raw log events into structured ones
2022-06-20 13:20:01 +02:00
Catala nix updated
eb26470ca8 update lock files 2022-06-20 11:18:32 +00:00
Emile Rolley
fb93be04dc fix: remove -s flag in the Makefile rule used to generate the french law library in OCaml 2022-06-16 17:30:33 +02:00