-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ Implement logging and fix a bug (still more to fix)
- Loading branch information
Showing
10 changed files
with
583 additions
and
122 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
(executable | ||
(public_name react_trace) | ||
(name main) | ||
(libraries react_trace)) | ||
(libraries react_trace base logs logs.fmt fmt fmt.tty)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,76 @@ | ||
let () = print_endline "Hello, World!" | ||
open! Base | ||
open React_trace | ||
|
||
(*let test_prog =*) | ||
(* let open Syntax in*) | ||
(* Prog.Expr Expr.(View [ Const Unit ])*) | ||
|
||
(*let test_prog =*) | ||
(* let open Syntax in*) | ||
(* Prog.( *) | ||
(* Comp*) | ||
(* ( { name = "C"; param = "x"; body = Expr.(View [ Const Unit ]) },*) | ||
(* Expr Expr.(View [ App { fn = Var "C"; arg = Const Unit } ]) ))*) | ||
|
||
(*let test_prog =*) | ||
(* let open Syntax in*) | ||
(* Prog.( *) | ||
(* Comp*) | ||
(* ( {*) | ||
(* name = "C";*) | ||
(* param = "x";*) | ||
(* body =*) | ||
(* Expr.( *) | ||
(* Stt*) | ||
(* {*) | ||
(* label = 0;*) | ||
(* stt = "s";*) | ||
(* set = "setS";*) | ||
(* init = Fn { param = "s"; body = Const (Int 42) };*) | ||
(* body =*) | ||
(* Seq*) | ||
(* ( App*) | ||
(* {*) | ||
(* fn = Var "setS";*) | ||
(* arg = Fn { param = "s"; body = Const (Int 42) };*) | ||
(* },*) | ||
(* View [ Const Unit ] );*) | ||
(* });*) | ||
(* },*) | ||
(* Expr Expr.(View [ App { fn = Var "C"; arg = Const Unit } ]) ))*) | ||
|
||
let test_prog = | ||
let open Syntax in | ||
Prog.( | ||
Comp | ||
( { | ||
name = "C"; | ||
param = "x"; | ||
body = | ||
Expr.( | ||
Stt | ||
{ | ||
label = 0; | ||
stt = "s"; | ||
set = "setS"; | ||
init = Fn { param = "s"; body = Const (Int 42) }; | ||
body = | ||
Seq | ||
( Eff | ||
(App | ||
{ | ||
fn = Var "setS"; | ||
arg = Fn { param = "s"; body = Const (Int 43) }; | ||
}), | ||
View [ Const Unit ] ); | ||
}); | ||
}, | ||
Expr Expr.(View [ App { fn = Var "C"; arg = Const Unit } ]) )) | ||
|
||
let () = | ||
Fmt_tty.setup_std_outputs (); | ||
Logs.set_reporter (Logs_fmt.reporter ()); | ||
Logs.set_level (Some Logs.Debug); | ||
Sexp.pp_hum Stdlib.Format.std_formatter (Syntax.Prog.sexp_of_t test_prog); | ||
Interp.run test_prog; | ||
Stdlib.exit (if Logs.err_count () > 0 then 1 else 0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,6 +24,7 @@ | |
dune | ||
(ocaml-variants (= 5.1.1+effect-syntax)) | ||
base | ||
fmt | ||
logs | ||
stdio) | ||
(tags | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.