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
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
kescher
db9eec3b9f
add support for duration multiplication
...
Signed-off-by: Jonathan Protzenko <protz@microsoft.com>
2022-05-31 11:17:38 -07:00
Louis Gesbert
f9fc1a8e8b
Formatting: sync with master
2022-05-12 15:10:55 +02:00
Denis Merigoux
025382a85d
Restore debug info
2022-05-05 14:34:29 +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
e7440e043c
Remove duplicated function
2022-04-12 17:07: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
48dda14dcd
Merge branch 'master' into c_backend
2022-04-12 10:53:46 +02:00
Denis Merigoux
a43f89a0f4
Parametrize Dcalc.scope_expr
2022-04-12 10:53:07 +02:00
Denis Merigoux
6f223d2519
Restore web build
2022-04-11 10:59:40 +02:00
Romain PRIMET
eafab30809
fix typo
2022-04-07 22:43:05 +02:00
Denis Merigoux
f2d1fab263
Refactoring to clean some Dcalc passes
2022-04-06 09:48:34 +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
9d05dad3fb
Passing all tests!
2022-04-04 15:56:45 +02:00
Denis Merigoux
84144c0a56
Tests now passing except for a few position and printing issues [skip ci]
2022-04-04 12:25:00 +02:00
Denis Merigoux
2652b9c406
Continuing to adapt code to new binded representation [skip ci]
2022-04-02 14:51:11 +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
9eec6a474c
format
2022-03-08 20:43:55 +01:00
Aymeric Fromherz
9cbfc13288
Merge branch 'master' into afromher_dcalc
2022-03-08 20:41:35 +01:00
Aymeric Fromherz
3fb14264c2
Implement equal_ops in dcalc
2022-03-08 20:39:45 +01:00
Aymeric Fromherz
ac42bf65a7
Refactor to extract common equal_exprs_list and equal_typs_list
2022-03-08 20:31:22 +01:00
Aymeric Fromherz
5b345b4782
format
2022-03-08 20:23:45 +01:00
Aymeric Fromherz
2fa2f36c1d
Optimize if_then_else when both branches are identical
2022-03-08 17:38:14 +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
Denis Merigoux
c07bab1377
FIXME -> TODO
2022-03-08 14:55:48 +01:00
Louis Gesbert
12ec65601d
Use format strings directly in debug/error/log functions
...
This avoids many intermediate calls to e.g. `Format.asprintf`; should result in
some cases in "more correct" use of `Format`¹, avoid the computation of unused
debug strings, and make the code more readable.
¹ for `Format` to work as expected, all intermediate calls need to go through
it. Some cases of formatting to an intermediate string then printing through Format
again are still present, but this makes the situation better.
2022-03-08 13:04:27 +01:00
Denis Merigoux
c65c38a2d5
Correct flag for enabling optimization
2022-02-24 16:46:02 +01:00
Alain
6fe75f3486
fv --> free_vars_set
...
free_vars --> free_vars_list
2022-02-21 11:51:01 +01:00
Alain
d7b9aa9492
fixing if-then-else bug
2022-02-18 16:11:22 +01:00
Alain
d512b27e2c
fmt
2022-02-18 15:49:23 +01:00
Alain
19bf2d934f
dcalc review
2022-02-18 15:31:52 +01:00
Denis Merigoux
48f064ccea
Adapt translation to new i/o invariants, bug discovered
2022-02-15 11:38:56 +01:00