Skip to content

Commit 6c9a93a

Browse files
committed
Add implicit decls/defs
1 parent 09f0dda commit 6c9a93a

File tree

19 files changed

+544
-202
lines changed

19 files changed

+544
-202
lines changed

doc/tuto.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ let test file =
6969
(* We can loop over the parsed statements to generated the typed statements *)
7070
let final_state, rev_typed_stmts =
7171
List.fold_left (fun (state, acc) parsed_stmt ->
72-
let state, typed_stmt = Typer.check state parsed_stmt in
73-
(state, typed_stmt :: acc)
72+
let state, typed_stmts = Typer.check state parsed_stmt in
73+
(state, List.rev_append typed_stmts acc)
7474
) (state, []) parsed_statements
7575
in
7676
let typed_stmts = List.rev rev_typed_stmts in

doc/type.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ let state =
4242
let () =
4343
let final_state, rev_typed_stmts =
4444
List.fold_left (fun (state, acc) parsed_stmt ->
45-
let state, typed_stmt = Typer.check state parsed_stmt in
46-
(state, typed_stmt :: acc)
45+
let state, typed_stmts = Typer.check state parsed_stmt in
46+
(state, List.rev_append typed_stmts acc)
4747
) (state, []) parsed
4848
in
4949
let typed_stmts = List.rev rev_typed_stmts in

src/bin/main.ml

+9-6
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,15 @@ let debug_parsed_pipe st c =
1212
Dolmen.Std.Statement.print c;
1313
st, c
1414

15-
let debug_typed_pipe st stmt =
16-
if Loop.State.get Loop.State.debug st then
17-
Format.eprintf "[logic][typed][%a] @[<hov>%a@]@\n@."
18-
Dolmen.Std.Loc.print_compact stmt.Loop.Typer_Pipe.loc
19-
Loop.Typer_Pipe.print stmt;
20-
st, stmt
15+
let debug_typed_pipe st stmts =
16+
if Loop.State.get Loop.State.debug st then begin
17+
List.iter (fun stmt ->
18+
Format.eprintf "[logic][typed][%a] @[<hov>%a@]@\n"
19+
Dolmen.Std.Loc.print_compact stmt.Loop.Typer_Pipe.loc
20+
Loop.Typer_Pipe.print stmt) stmts;
21+
Format.eprintf "@.";
22+
end;
23+
st, stmts
2124

2225

2326
(* Run dolmen (regular use) *)

0 commit comments

Comments
 (0)