armandsalek
f4f42e1297
Update examples/tutorial_en/tutorial_en.catala_en
...
Co-authored-by: Louis Gesbert <louis.gesbert@ocamlpro.com>
2023-04-05 19:15:16 +02:00
armandsalek
f66c7eefde
Add an instruction and replace some mispellings
2023-04-05 19:15:16 +02:00
Denis Merigoux
ad02a0959d
Merge branch 'master' into aides_logement_outre_mer
2023-04-03 14:12:10 +02:00
Denis Merigoux
6d71d52a2e
Update tests and create disable_warnings option
2023-03-31 16:43:03 +02:00
Denis Merigoux
b2d02f4b0f
Fixed all tests
2023-03-17 18:44:19 +01:00
Louis Gesbert
57e29f60bd
Refactor Python dep handling + update cheat-sheet ( #419 )
2023-03-03 11:05:56 +01:00
Louis Gesbert
84e6c70d66
Tutorial: fix overfull hbox
2023-03-02 14:32:07 +01:00
Louis Gesbert
d3ccfe9b91
Adjust examples for the new function declaration syntax
2023-02-28 15:53:50 +01:00
Louis Gesbert
49b4f8a8d8
Tutorial: add top-level value definitions as an annex
...
The cheat-sheet still needs to be updated, I'll do that once we have a unified
syntax for function types and multiple arguments at the top-level and within
scopes.
2023-02-23 11:35:44 +01:00
Denis Merigoux
fa84dd4330
Splitting long lines
2023-01-05 16:20:51 +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
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
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
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
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
1c3d5b9a75
Fix all lines too long problems & update assets
2022-08-29 15:46:06 +02:00
Louis Gesbert
1d268a940b
Add tests for the examples as well
2022-07-08 17:18:58 +02:00
Louis Gesbert
81fe7eba47
Tutorial: Add section on cumulative exceptions
2022-05-30 14:45:52 +02:00
Louis Gesbert
569a647f3f
Tutorial: a couple typos
2022-05-16 15:21:15 +02:00
Sandy Maguire
8bc3a87376
Fix typos in English tutorial
2022-03-16 18:07:19 -07:00
Denis Merigoux
8167d7ee00
Simple tests
2022-03-06 17:13:40 +01:00
Denis Merigoux
cf586c6b5e
Documentation: cheat sheet and tutorial
2022-02-28 15:11:40 +01:00
Denis Merigoux
2a3e622750
Tutorial on context variables
2022-02-09 18:54:58 +01:00
Denis Merigoux
9bb858b79b
Added input/output/internal description in tutorial
2022-02-09 18:06:03 +01:00
Denis Merigoux
1c4a0bdd5d
Updated all examples with input/output decorations [skip ci]
2022-02-07 18:18:23 +01:00
Denis Merigoux
c51ea49962
Tutorial corrections as suggested by @rmonat
2022-01-26 15:25:58 +01:00
Denis Merigoux
3e9a8521e3
Significative improvement of the tutorial
2022-01-19 18:11:22 +01:00
Denis Merigoux
987c3204bc
Kickstarting tutorial changes
2022-01-19 14:30:33 +01:00
Denis Merigoux
a963a01f60
Unit tests for examples now use clerk
2022-01-11 10:42:12 +01:00
Edwin Török
c454c0531a
examples/tutorial_en: be explicit about @ and ^ symbols
...
Use both their verbose name and symbols to make it obvious what they
refer to.
Signed-off-by: Edwin Török <edwin@etorok.net>
2021-10-10 16:05:00 +01:00
Edwin Török
ee03af4afc
examples/tutorial_en: headers are prefixed with # not @
...
Since a42d0c7728
# is used.
Signed-off-by: Edwin Török <edwin@etorok.net>
2021-10-10 16:03:56 +01:00
Edwin Török
c201fee6b8
examples/tutorial_en: fix spelling
...
paragrah -> paragraph
analyse -> analyze
formulae -> formulas
substraction -> subtraction
adresses -> addresses
mentionned -> mentioned
conditionnally -> conditionally
explicitely -> explicitly
datatypes -> data types
Signed-off-by: Edwin Török <edwin@etorok.net>
2021-10-10 15:56:07 +01:00
Emile Rolley
9aaa614410
refactor(parser): add the new catala-metadata markup
2021-10-01 10:01:25 +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
EmileRolley
a42d0c7728
refactor(tests): udpates tests based on the english lexer
2021-03-09 20:48:35 +01:00
Denis Merigoux
50bccd8d13
Generated OCaml has valid syntax
2021-01-28 13:58:59 +01:00
Denis Merigoux
a6338c3a9c
Typos
2021-01-16 18:06:22 +01:00
XB
a44c9076ec
CamelCase is not an OCaml concept
2021-01-12 23:13:54 -05:00
Denis Merigoux
839310d5ba
Small tweak to make tutorial more climactic
2021-01-07 22:38:56 +01:00
Louis Gesbert
3b93fc5b43
Tutorial: a few typos
2021-01-04 13:50:33 +01:00
James Barnes
34094be363
create seperate folders for English and French tutorials
2020-12-24 11:12:57 +01:00