Commit Graph

702 Commits

Author SHA1 Message Date
Louis Gesbert
5efa61a0ce Clerk: rewrite 'clerk runtest' to use the new lightweight lexer
* Obsolete code for included tests has been removed

* The engine uses a proper lexer and is much simplified

* An inline test in the middle of the file now only "sees" the file up to that
  point. This fixes an issue where we had spurious errors when a type error was
  added at the end of a file, and it would pop up in tests before it. This makes
  files including many tests much more practical.

* diffing and resetting the tests has been reintroduced (done at the moment in
  Ninja, but for more control (count number of failed tests, etc.) we could put it
  back into Clerk at some point

* The Catala CLI can now take an input from stdin (with the possibility to link
  a (possibly fake) on-disk file for error reporting and file locations ; this
  is useful for running tests)
2023-09-27 13:18:18 +02:00
Louis Gesbert
442997aea5 Clerk: rework CLI to use subcommands 2023-09-27 13:14:08 +02:00
Denis Merigoux
524c8b1274
Commentaire précis 2023-09-19 13:44:01 +02:00
Denis Merigoux
f57127c0aa
Fix anteriority bug 2023-09-19 12:07:02 +02:00
armandsalek
ff3060fa04
implémenter calcul de âge_l351_1_5_sécu qui a remplacé âge_l161_17_2_sécu dans le code actuel 2023-09-19 11:55:47 +02:00
Denis Merigoux
a6e15eb150
Mise à jour CCH reglementaire au 2023-09-01
Manque des implémentations de la réforme des retraites
2023-09-19 11:55:31 +02:00
Louis Gesbert
3cc77f4601
Improvements to the Polish translation (#499) 2023-09-13 16:19:06 +02:00
Artur Cygan
c33cccd7c1 Improvements to the Polish translation 2023-08-17 12:15:25 +02:00
Louis Gesbert
edd6dce0d8 Disable recursive tests reset for now; remove rel paths in test out 2023-08-04 12:08:18 +02:00
Louis Gesbert
378669b09e Implement reversing the dependencies for tests
This works for the `--reset` option, but I have some doubts about it.
2023-08-04 12:08:18 +02:00
Aminata-Dev
94f8eac858 Better indications for the user :
- We're able to say from the parser what the user could have written. It may not be complete due to the acceptable function of Menhir : it is only an indication given to the user (and not intended to be an adaptive documentation)
- .mli file added : module interface for suggestions
- Add a test that provides a typographical or a logical error.
- Documentation and type / name changes for suggestions
2023-07-12 16:32:55 +02:00
Aminata-Dev
af9c708960 Better help for the user
- Clearer (more detailed) error messages (see parser.messages, parser_driver.ml ->)
	--> Parser_driver.ml : we're more precise and show all possible instructions to the user.
- Suggestions.ml : unimportant display changes + renaming
2023-07-12 11:55:11 +02:00
Aminata-Dev
b0d16c1a58 Tests updated 2023-07-12 11:55:11 +02:00
Aminata-Dev
b087ca4f47 Improve suggestions
- Improved implementation of suggestions (suggestion_minimum_levenshtein_distance_association > suggestions.ml)
- Magnifying glass emoji added for suggestions
- Improve display by...
	- Fixing "Pos.ml" (pretty-printing box not closed)
	- Remove unnecessary spaces
- compiler/surface/parserdriver.ml
	- Optionnal suggestions added when raising a parser error
	- Function "levenshtein_distance" removed and replaced by "Suggestions.levenshtein_distance"
- Tests updated (mostly line breaks and spacing changes)
- Variable names renamed for greater clarity
- (Based on commit 0813f5c36e)
2023-07-12 11:55:11 +02:00
Aminata-Dev
75b6251b43 Match the compiler code to the new type of error message content 2023-07-12 11:55:11 +02:00
Denis Merigoux
50113586e3 With @aminata-dev update Messages.Content 2023-07-12 11:55:11 +02:00
Louis Gesbert
89e90271c1 Implement an additional localised, user-facing value printer 2023-07-03 16:42:54 +02:00
Louis Gesbert
0f9ee2c72e Refacter the main Driver module
- Use separate functions for successive passes in module `Driver.Passes`
- Use other functions for end results printing in module `Driver.Commands`

As a consequence, it is much more flexible to use by plugins or libs and we no
longer need the complex polymorphic variant parameter.

This patch leverages previous changes to use Cmdliner subcommands and
effectively specialises the flags of each Catala subcommand.

Other changes include:

- an attempt to normalise the generic options and reduce the number of global
  references. Some are ok, like `debug` ; some would better be further cleaned up,
  e.g. the ones used by Proof backend were moved to a `Proof.globals` module and
  need discussion. The printer no longer relies on the global languages and prints
  money amounts in an agnostic way.
- the plugin directory is automatically guessed and loaded even in dev setups.
  Plugins are shown by the main `catala` command and listed in `catala --help`
- exception catching at the toplevel has been refactored a bit as well; return
  codes are normalised to follow the manpage and avoid codes >= 128 that are
  generally reserved for shells.

Update tests
2023-07-03 16:42:54 +02:00
Denis Merigoux
26dd6012b1
Better French wording 2023-06-27 10:48:58 +02:00
Siggy Scott
b034613499 Correct a variable name in the French-language tutorial. 2023-06-23 13:22:58 -04:00
Siggy Scott
20aa04eb96 Tweak tutorial language in response to #273. 2023-06-23 08:33:47 -04:00
Denis Merigoux
5f48e5dac1
Merge branch 'master' into closure_conversion 2023-06-20 11:02:13 +02:00
Denis Merigoux
615ad54f08
Remove unmaintained examples (fix #468) (#480) 2023-06-20 10:25:43 +02:00
Denis Merigoux
71ead0c6fa
Remove all mentions 2023-06-19 12:01:06 +02:00
Denis Merigoux
0ca42cbcf9
Fix headings 2023-06-19 11:37:58 +02:00
Denis Merigoux
147e70feed
Remove unmaintained examples (fix #468) 2023-06-19 11:21:00 +02:00
Denis Merigoux
420348beda Added a last TODO and put big example under CI 2023-06-18 21:38:00 +02:00
Louis Gesbert
691d81ba72 Makefiles: fix catala arguments order
the command name now needs to be first
2023-06-18 18:35:39 +02:00
Louis Gesbert
fcadd9808e Update tests with whitespace changes 2023-06-08 14:03:08 +02:00
Denis Merigoux
6bc4cbd066
New SMIC value: Update assets 2023-05-25 18:48:23 +02:00
Denis Merigoux
38081245b8
Really fix #466 2023-05-23 16:39:21 +02:00
Denis Merigoux
a00501fffa
Fix typo causing bad parsing 2023-05-23 15:39:41 +02:00
Denis Merigoux
e092679b75
Fixing #466 by reversing exception precedence 2023-05-23 14:12:26 +02:00
Denis Merigoux
d70886431d
Fix false positive found by proof mode with an assertion clearly stating the impossible situations 2023-04-28 10:39:19 +02:00
Denis Merigoux
e6bccd716d
Fix a Catala program bug thanks to Proof mode! 2023-04-27 18:03:27 +02:00
Denis Merigoux
a954942fd9
Bug in the law found with proof mode? 2023-04-27 16:58:40 +02:00
Denis Merigoux
9b056f3ca1
Update assets and fix errors after rebase 2023-04-27 12:18:50 +02:00
Denis Merigoux
14dd879cc5
Restore tests, update assets 2023-04-27 12:14:27 +02:00
Denis Merigoux
e920529fad
Fix with informations by @JusBanuls 2023-04-27 12:14:16 +02:00
Denis Merigoux
9b06bb66db
Fix tests and restore CI 2023-04-27 12:14:16 +02:00
Denis Merigoux
1b35d6f064
Update allocations_familiales to correct legislative wording 2023-04-27 12:13:50 +02:00
Denis Merigoux
3e61bd633c
Update BMAF 2023-04-27 12:13:50 +02:00
Denis Merigoux
26078d2882
Plus d'informations 2023-04-27 12:13:50 +02:00
Denis Merigoux
7451516ba2
Beginning to incorporate remarks by DHUP 2023-04-27 12:13:50 +02:00
Denis Merigoux
ada8e4941a
Delete variable EVERYWHERE 2023-04-27 12:13:50 +02:00
Denis Merigoux
e7f56b4310
Removed useless variable 2023-04-27 12:13:19 +02:00
Denis Merigoux
28577c7a5e
Fix tests with @JusBanuls 2023-04-27 12:10:47 +02:00
Denis Merigoux
25d6178d42
Add training lines 2023-04-27 12:10:47 +02:00
JusBanuls
537acd320d
Ajouts de plusieurs tests et correction de bugs 2023-04-27 12:10:14 +02:00
Denis Merigoux
75c2a24b98
Changed position formatting 2023-04-27 12:09:22 +02:00