Louis Gesbert
d9fbaa704b
Restore some commented out code, add some comments
2022-07-19 21:41:55 +02:00
Louis Gesbert
b9099ac7a4
Use resolved types in type annotations
...
Adding an 'inferring' annotation type only used during typing
2022-07-19 18:47:00 +02:00
Louis Gesbert
61063b5234
Small cleanup and clarifying a dark spot of the Ast interface
2022-07-13 12:28:08 +02:00
Louis Gesbert
83de1a229b
Mark the optimization passes as untyped
...
It's not expected to stay that way forever, but some additional effort will be required for them to preserve (or restore) types; until then, be safe and don't forward possibly incorrect information.
2022-07-13 12:17:43 +02:00
Louis Gesbert
7485c7f2ce
Reformat
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
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
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
Denis Merigoux
c7b84ca2d0
Merge pull request #244 from CatalaLang/c_backend
...
Bringing structure to the Lcalc AST
2022-05-05 14:22:26 +02:00
Denis Merigoux
78e8275d5e
Adds a decimal rounding operator
2022-04-29 21:18:15 +02:00
Denis Merigoux
6ea73a4291
Progress on refactoring [skip ci]
2022-04-26 12:07:39 +02:00
Denis Merigoux
c1c2953131
Fixing more errors [skip ci]
2022-04-25 10:19:04 +02:00
Denis Merigoux
88a522d120
Changed maps and folds for Dcalc
2022-04-15 12:16:22 +02:00
Denis Merigoux
8be3d1cfc9
Made more functions generic in Dcalc.Ast
2022-04-12 17:54:00 +02:00
Denis Merigoux
33ff03a356
Map visitor for Dcalc
2022-04-12 11:51:33 +02:00
Denis Merigoux
b24dbc8360
Remove logging calls for vc generation
2022-04-12 11:14:39 +02:00
Denis Merigoux
a43f89a0f4
Parametrize Dcalc.scope_expr
2022-04-12 10:53:07 +02:00
Denis Merigoux
f6047a43ea
Added boxed constructors for Dcalc
2022-04-06 09:35:07 +02:00
Denis Merigoux
f6c8e7fbd9
Crediting author of moved code
2022-04-04 18:06:40 +02:00
Denis Merigoux
8f39b65bb6
Started replacement of Ast by Binded_representation in Dcalc [skip-ci]
2022-04-02 12:29:43 +02:00
Denis Merigoux
cdac6de9fe
Implement the round money builtin
2022-03-17 12:30:14 +01:00
Aymeric Fromherz
9cbfc13288
Merge branch 'master' into afromher_dcalc
2022-03-08 20:41:35 +01:00
Aymeric Fromherz
89d69c2316
Implement equality function on dcalc expressions
2022-03-08 17:35:08 +01:00
Denis Merigoux
5bd66142a6
Big reformatting
...
ocamlformat 0.19.0 -> 0.20.1
100 -> 80 columns per line
Reestablished @emilerolley's smart fun break
2022-03-08 15:03:14 +01:00
Alain
6fe75f3486
fv --> free_vars_set
...
free_vars --> free_vars_list
2022-02-21 11:51:01 +01:00
Alain
19bf2d934f
dcalc review
2022-02-18 15:31:52 +01:00
Denis Merigoux
69a7465339
Merge branch 'master' into alain_default-option
2022-02-14 12:09:11 +01:00
Denis Merigoux
9bb858b79b
Added input/output/internal description in tutorial
2022-02-09 18:06:03 +01:00
Denis Merigoux
97f8875a39
Merge branch 'master' into alain_default-option
2022-02-04 15:35:52 +01:00
Denis Merigoux
a06dfbfaa5
Assets and formatting
2022-02-04 15:29:31 +01:00
Alain
6da5cc518b
cleanup dcalc-ast.ml
2022-02-04 12:33:26 +01:00
Alain
88eedbc000
ocamlformat
2022-02-04 09:27:10 +01:00
Alain
b777d3215b
computing of free vars+ more debuging
...
finally found an error (List.fold_left instead of List.fold_right
2022-02-04 09:24:51 +01:00
Denis Merigoux
0d90dcea00
Better optimizations with values instead of literals
2022-02-02 10:30:39 +01:00
Denis Merigoux
13b476d0a1
[skip ci] reorganized desugared to scope encoding, broke some invariants
...
WIP: fixed some bugs and provided documentations but one thing missing
2022-01-28 17:31:31 +01:00
Alain
1bfb891aa1
printing dcalc and lcalc ast
2022-01-25 13:55:17 +01:00
Denis Merigoux
d2977b48ce
Documentation pass
2022-01-19 10:54:16 +01:00
Denis Merigoux
ca7b009b02
Should compile
2022-01-10 14:35:51 +01:00
Denis Merigoux
ab194c76fd
Give function for retrieving variable types
2022-01-10 14:32:27 +01:00
Denis Merigoux
50224851f5
Port optimizations to Dcalc
2022-01-07 18:36:56 +01:00
Alain
63ff6cfbb3
wip (compiling but can't compile catala program without internal errors)
...
instrumentation of Dcalc.expr to show internals representation
2021-12-16 19:16:57 +01:00
Denis Merigoux
9f0929b86d
Fix the final bug!
2021-12-10 17:55:24 +01:00
Denis Merigoux
e8a95db9ed
Trying to box everything but optimizations complaining
2021-12-10 16:54:51 +01:00
Denis Merigoux
00a998462a
Implementation OK, now on to debugging Bindlib [skip ci]
2021-12-10 16:30:36 +01:00
Denis Merigoux
c456a62cb3
Builds but with empty stubs [skip ci]
2021-12-09 22:59:39 +01:00