Commit Graph

260 Commits

Author SHA1 Message Date
Denis Merigoux
2b6e7c8b98
Working prototype of clerk, the new build system for Catala 2022-01-10 17:57:58 +01:00
Denis Merigoux
909e539cdc
Fixed all bugs 2022-01-05 15:57:18 +01:00
Denis Merigoux
82c09ee455
Fixed a bug [skip ci] 2022-01-05 15:37:34 +01:00
Denis Merigoux
e9d54e120d
Changed label scoping from scope to scope definition key [skip ci] 2022-01-03 18:39:59 +01:00
Denis Merigoux
3f41156282
Motivaing example [skip-ci] 2022-01-03 11:18:35 +01:00
Denis Merigoux
dde455c560
Merge branch 'master' into grouped_exceptions 2021-11-28 13:19:00 +01:00
Denis Merigoux
07167ee911
Better error message 2021-11-28 13:16:55 +01:00
Denis Merigoux
4137641c8c
Better error message 2021-11-28 13:16:21 +01:00
Denis Merigoux
d1b75b047b
Give a name to every rule and def, label or not 2021-11-28 13:09:44 +01:00
Denis Merigoux
d2ae2d72ee
Error when duplicate labels 2021-11-28 12:28:55 +01:00
Denis Merigoux
166baf42af
Error when duplicate labels 2021-11-28 12:28:30 +01:00
Denis Merigoux
8c0694ba15
Fixes #101 2021-11-12 09:43:23 +01:00
Denis Merigoux
56baf91923
Remove prefixes to each line in messages, keep only first line 2021-11-06 23:04:12 +01:00
Emile Rolley
9aaa614410 refactor(parser): add the new catala-metadata markup 2021-10-01 10:01:25 +02:00
Denis Merigoux
b72d8e09ee
Restore typechecking version of CGI example 2021-09-28 12:01:08 +02:00
EmileRolley
6169d19b1e feat(compiler): add collection concatenation operator 2021-07-08 16:27:46 +02:00
Denis Merigoux
bbd50747d9
Big renaming and dir reorg 2021-06-21 11:39:06 +02:00
EmileRolley
1597f43a1a refactor(compiler): unreachable match case error change to warning 2021-06-03 16:43:04 +02:00
EmileRolley
3c385e41a6 fix(tests): replace wildcard keyword with the right syntax 2021-06-03 15:47:07 +02:00
EmileRolley
5060565ed2 fix: update all syntax highlighting in order to match widlcard keywords 2021-06-03 15:33:40 +02:00
EmileRolley
ed51544a10 feat(compiler): improve error messages for not ending wildcards 2021-06-03 12:24:12 +02:00
EmileRolley
846c85a9a6 test(compiler): add unit tests for wildcard in patterns 2021-06-03 12:24:12 +02:00
EmileRolley
71d92aeef1 feat(compiler): start to add wildcard in patterns 2021-06-03 12:24:12 +02:00
EmileRolley
be90d61dc1 fix(compiler): refactor and fix the duration division operator evaluation 2021-05-31 10:42:20 +02:00
EmileRolley
4e53358fd6 feat(compiler): add the Runtime.IndivisableDurations exception handling 2021-05-31 10:26:51 +02:00
EmileRolley
1572244e2d fix(tests): add test case for the good utilisation of the duration division operator 2021-05-31 10:26:51 +02:00
EmileRolley
4e84f424eb feat(compiler): start to add the duration division operator 2021-05-31 10:26:51 +02:00
EmileRolley
f907431504 refactor(compiler): factorize the UncomparableDurations exception managment in Dcalc.interpreter + add unit tests 2021-05-29 20:17:22 +02:00
EmileRolley
31f1c13763 fix(compiler)!: fix the Division_by_zero managment in Dcalc.interpreter 2021-05-29 18:56:20 +02:00
EmileRolley
27bd227079 fix(tests): update the .run rule in order to manage all catala file extensions 2021-05-29 18:54:00 +02:00
EmileRolley
ec43e82d09 docs(test): update the README.md 2021-05-26 21:57:51 +02:00
EmileRolley
0ffbb9b266 refactor(tests)!: migrate test file from the abbreviated syntax to the english one 2021-05-26 21:16:29 +02:00
EmileRolley
75570864d2 fix(tests): update the .in rule fo the Makefile in order to manage all catala extensions 2021-05-26 18:19:33 +02:00
EmileRolley
866a29a643 feat(lexer): improve grave accent lexing outside code blocks 2021-05-24 23:04:43 +02:00
EmileRolley
4e168eff64 feat(lexer): update the polish lexer to support grave accent outside code blocks 2021-05-24 16:23:45 +02:00
EmileRolley
d00ba4740f feat(tests): modify the .out rule of the Makefile in order to manage other input file syntax than the abbrieviated one 2021-05-24 15:54:27 +02:00
EmileRolley
c317332218 tests(lexer): add tests for the literate programming 2021-05-24 15:54:27 +02:00
EmileRolley
4e6e532ce8 feat(lexer): allows to use '`' inside law text 2021-05-24 15:54:27 +02:00
Denis Merigoux
3c8d187be0
Big refactoring of the literate programming structure
Partially fixes #120
Removes the distinction between headers and articles, streamlines the surface AST
Changes affects lexers and parser
2021-05-15 01:16:08 +02:00
Denis Merigoux
147e35083e
Point directly to executable instead of dune exec 2021-05-14 18:44:06 +02:00
Denis Merigoux
d69f1a4a39
Fixes #107 2021-04-29 17:46:56 +02:00
Denis Merigoux
33f781c3b5 Update tests with better error message 2021-04-03 19:35:59 +02:00
Denis Merigoux
c4fc0ff622
Merge branch 'master' into xor 2021-03-19 16:23:35 +01:00
Denis Merigoux
896a83db4a
Fix test output 2021-03-17 19:43:36 +01:00
EmileRolley
8f9ec2b623 fix: update all ASTs and the interpreter in order to support the 'xor' operand 2021-03-16 20:34:03 +01:00
EmileRolley
f507620462 feat(catala_nv): add the xor operator 2021-03-16 18:34:59 +01:00
EmileRolley
b40abce52f refactor(tests): change the date format to ISO 2021-03-16 12:10:33 +01:00
Denis Merigoux
d26bef400b
Fix #47 2021-03-12 17:07:25 +01:00
EmileRolley
3f88dbe2ae fix(tests): modify some of the expected test outputs because of removed trailling whitespaces 2021-03-09 22:08:55 +01:00
EmileRolley
c0a9344eca refactor(tests): update tests based on the abbreviated english lexer 2021-03-09 22:07:31 +01:00
Denis Merigoux
3dcba2fede Speed up compilation using batch let bindings 2021-02-01 23:35:15 +01:00
Denis Merigoux
5c5dbc542f Js version of Allocations familiales 2021-02-01 20:09:16 +01:00
Denis Merigoux
d88ccc38f6 Switched scope functions input to struct instead of many arguments 2021-02-01 15:57:19 +01:00
Aymeric Fromherz
fec4334b49 Allow fully qualified enum names in matches 2021-01-26 11:41:20 -05:00
Aymeric Fromherz
2e71cc503c Fix typo in grammar 2021-01-26 10:47:48 -05:00
Aymeric Fromherz
f154ec15ad Add support for fully qualified enum elements 2021-01-26 10:38:10 -05:00
Aymeric Fromherz
e1ac9564c2 Add a few tests for fully qualified struct accesses 2021-01-25 23:08:30 -05:00
Aymeric Fromherz
ec1695e41e Add failing test for ambiguous struct fields 2021-01-25 22:31:48 -05:00
Aymeric Fromherz
736f74d4f0 README 2021-01-25 01:17:43 -05:00
Aymeric Fromherz
ba03d2db78 Move tests to appropriate folders 2021-01-25 01:16:46 -05:00
Aymeric Fromherz
2bc56f5c92 Modify Makefile to have output folder in subdirectory of good or bad 2021-01-25 01:09:51 -05:00
Aymeric Fromherz
e63bdf0634 More precise pattern matching when looking for source file in test framework 2021-01-23 20:57:31 -05:00
Aymeric Fromherz
5823c2ec3f update test README 2021-01-23 20:51:30 -05:00
Aymeric Fromherz
483400ea19 Move tests to their appropriate directory 2021-01-23 20:49:17 -05:00
Aymeric Fromherz
20d4a8ed6f Change tests Makefile to separate between good and bad tests 2021-01-23 20:26:10 -05:00
Aymeric Fromherz
339b6174d2 Add test for unlabeled exceptions in different code blocks 2021-01-21 23:48:08 -05:00
Aymeric Fromherz
216bd87991 Improve unlabeled exceptions: Default definitions and unlabeled exceptions in the same scope can now be defined in different code blocks 2021-01-21 23:47:48 -05:00
Denis Merigoux
d486494177 Merge branch 'master' into visitors_and_positions 2021-01-21 21:10:22 +01:00
Aymeric Fromherz
6f64e4411e Add tests for unlabeled exceptions + better error message when there is no default definition 2021-01-21 00:15:37 -05:00
Denis Merigoux
3e57fe0276 Enhanced log with explanations of which definition is taken 2021-01-20 19:58:48 +01:00
Denis Merigoux
4d1d3a2e1c Reset tests 2021-01-20 19:21:02 +01:00
Denis Merigoux
19a6a171bd Fixes #65 2021-01-18 16:21:55 +01:00
Denis Merigoux
a6338c3a9c Typos 2021-01-16 18:06:22 +01:00
Denis Merigoux
c562cc25be Fixed date/month US inversion 2021-01-14 13:13:32 +01:00
Denis Merigoux
852a6412eb Changed odate to calendarLib 2021-01-14 13:04:15 +01:00
Denis Merigoux
267baea28d Fixes #58 2021-01-14 00:17:24 +01:00
Denis Merigoux
6787d5b882 Fixes the exception tree building algorithm 2021-01-13 19:07:35 +01:00
Denis Merigoux
44d7b616a4 Improve type error messages 2021-01-13 12:04:14 +01:00
Denis Merigoux
ea117d1816 Added exceptions tests 2021-01-11 15:29:02 +01:00
Denis Merigoux
e5c6a196e2 Added filter and map operators 2021-01-10 18:11:46 +01:00
Denis Merigoux
f51d8833c7 Implement argmin and argmax 2021-01-10 17:07:41 +01:00
Denis Merigoux
9c795b5010 Fixed typing error 2021-01-06 18:42:22 +01:00
Nicolas Chataing
5aa0e391ff Add a fail test 2021-01-06 17:23:58 +01:00
Nicolas Chataing
5038b75da1 Implement quick pattern check desugaring 2021-01-06 17:04:46 +01:00
Nicolas Chataing
c4d6220240 Handle extrema operators on collections 2021-01-06 12:41:24 +01:00
Denis Merigoux
8f2811b66f Changed output formatting 2020-12-31 00:32:17 +01:00
Denis Merigoux
89fe5878b0 Various small fixings 2020-12-30 12:02:09 +01:00
Denis Merigoux
be9e7e2a1e Added collection length and mem test 2020-12-30 11:50:19 +01:00
Denis Merigoux
2cfb348274 Debugged unification and typing 2020-12-30 01:13:28 +01:00
Denis Merigoux
7318b51e25 Debugging unification... 2020-12-30 01:02:04 +01:00
Denis Merigoux
5f58e93c6e Implemented all aggregate desugaring 2020-12-29 23:43:00 +01:00
Denis Merigoux
a37357bb56 Array type is beginning to work 2020-12-29 22:26:10 +01:00
Denis Merigoux
2068a6ffe4 Better test suite terminal output 2020-12-21 16:15:42 +01:00
Denis Merigoux
ea1611cd41 Flipped defaults to an exception-based structured 2020-12-18 15:59:15 +01:00
Denis Merigoux
f1b1ef7992 Update test result 2020-12-17 20:13:19 +01:00
Denis Merigoux
f282d9586b Improved readmes 2020-12-14 10:59:15 +01:00
Denis Merigoux
ebf14f6121 Added assertions, starting to execute section132 2020-12-10 18:11:43 +01:00
Denis Merigoux
a195a64677 Duration is number of days 2020-12-10 14:00:00 +01:00
Denis Merigoux
540057fe27 Updated parser error and some test 2020-12-10 11:53:55 +01:00
Denis Merigoux
5004ee12d2 Added duration literals but comparison buggy 2020-12-10 11:51:50 +01:00
Denis Merigoux
902c3f8d7d Added date and durations handling 2020-12-10 11:35:56 +01:00
Denis Merigoux
a4916208ba amount -> money 2020-12-10 09:35:36 +01:00
Denis Merigoux
159901b993 Performing nearest rounding for money multiplication 2020-12-09 18:14:52 +01:00
Denis Merigoux
45684e124c Better test harness and doc 2020-12-09 17:31:42 +01:00
Denis Merigoux
5deee89562 Run tests in paralell 2020-12-09 17:09:43 +01:00
Denis Merigoux
fe130f90c7 Update simple test 2020-12-09 16:51:03 +01:00
Denis Merigoux
b0b231b38a Handles infinite precision 2020-12-09 16:45:23 +01:00
Denis Merigoux
be563a24f6 Defined operators for dec and money 2020-12-09 14:51:22 +01:00
Denis Merigoux
ae05498049 Added support for decimals 2020-12-09 12:20:20 +01:00
Denis Merigoux
170bd7685f Added error when a scope variable evaluates to empty 2020-12-09 11:23:03 +01:00
Denis Merigoux
5ff7d78a9e Fixed various edge cases of enums 2020-12-09 10:36:09 +01:00
Denis Merigoux
5abb73157f Fix content/type lexer issue in nv 2020-12-06 18:09:48 +01:00
Denis Merigoux
15247aa28a Pass simple test with enums 2020-12-06 17:56:06 +01:00
Denis Merigoux
4da1c7f9c8 Implmemented enum desugaring but parser error 2020-12-06 17:48:15 +01:00
Denis Merigoux
9170630a6e Added better test 2020-12-06 13:00:38 +01:00
Denis Merigoux
ee0cb1eefc Preventing recursive type definitions 2020-12-06 12:32:36 +01:00
Denis Merigoux
8abe20849d Passing simple test 2020-12-06 11:42:47 +01:00
Denis Merigoux
70aa8ae2c1 Simple struct test passing 2020-12-05 17:27:08 +01:00
Denis Merigoux
0f853909ef Implemented name resolution 2020-12-04 18:02:49 +01:00
Denis Merigoux
7e674fa69d Tabs to spaces 2020-12-04 15:14:29 +01:00
Denis Merigoux
43829d65a6 Added more tests 2020-12-03 18:59:14 +01:00
Denis Merigoux
3d48effb17 Fix all tests 2020-11-27 19:09:16 +01:00
Denis Merigoux
4599403d22 Changed error message 2020-11-27 19:04:57 +01:00
Denis Merigoux
94f47b3ac4 Changed error message 2020-11-27 19:04:22 +01:00
Denis Merigoux
80ef321123 Better func test 2020-11-27 19:00:08 +01:00
Denis Merigoux
180d56df13 Better error messages 2020-11-27 18:36:38 +01:00
Denis Merigoux
ae1c2c6e02 Passing all tests! 2020-11-27 17:21:37 +01:00
Denis Merigoux
0443221e8b Fixed functions 2020-11-27 16:27:10 +01:00
Denis Merigoux
64cf1fd7cd Test without func now pass! 2020-11-27 11:54:22 +01:00
Denis Merigoux
341ee710d8 Fixed translation bug 2020-11-27 11:37:21 +01:00
Denis Merigoux
453c3afc91 Another example passing 2020-11-26 16:32:52 +01:00
Denis Merigoux
4a181ab4b7 First test passing 2020-11-26 16:22:08 +01:00
Denis Merigoux
69f0751037 Translate and typechecking simple exemple 2020-11-26 15:48:26 +01:00
Denis Merigoux
d3fe18aa18 Pretty-printing, fixing bugs in scope_to_dcalc 2020-11-26 13:38:42 +01:00
Denis Merigoux
cdfa9038cf Literate programming AST now tree-shaped 2020-10-04 01:25:37 +02:00
Denis Merigoux
3291d108ec Bugfixing 2020-09-13 18:48:35 +02:00
Denis Merigoux
f014c589ca Completely rewrote interpreter, builds 2020-09-13 18:15:57 +02:00
Denis Merigoux
0f43975182 Cleaned lexing code and rationalized non-verbose syntax 2020-08-08 18:32:44 +02:00
Denis Merigoux
df25d5d94d Automated test suite! 2020-08-07 17:37:28 +02:00
Denis Merigoux
03a7827dda Better error handling 2020-08-07 15:29:52 +02:00
Denis Merigoux
1b0da2404e Blue for spans! 2020-08-07 12:56:34 +02:00
Denis Merigoux
fd681078aa Restructured error handling 2020-08-07 12:51:51 +02:00
Denis Merigoux
351f1f4cc1 Improved error messages 2020-08-07 10:57:57 +02:00
Nicolas Chataing
70c6a833e2 Add function test 2020-08-06 20:59:25 +02:00
Nicolas Chataing
974769c013 Fix bug in the interpreter 2020-08-05 11:06:20 +02:00
Nicolas Chataing
623abf1a4e Change ~= to |= for the programmative style 2020-08-04 12:38:49 +02:00
Nicolas Chataing
60aa306a3f Code cleanup 2020-08-04 12:16:28 +02:00
Nicolas Chataing
e2879cc68d Rewrite tests with programmative style 2020-08-04 10:30:35 +02:00
Nicolas Chataing
94ab2f4147 Change test to match programmative style 2020-08-04 08:11:23 +02:00
Nicolas Chataing
84835b0a79 Add non verbose lexing 2020-08-03 18:07:09 +02:00