diff options
Diffstat (limited to 'discocaml/discocaml.ml')
-rw-r--r-- | discocaml/discocaml.ml | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/discocaml/discocaml.ml b/discocaml/discocaml.ml index f11a81b..df5cef3 100644 --- a/discocaml/discocaml.ml +++ b/discocaml/discocaml.ml @@ -17,7 +17,8 @@ type request = { expr : string; command : command } type response_expr = { expr : string; has_redex : bool } [@@deriving to_yojson { exn = true }] -type response = [ `Error of string | `Expr of response_expr ] +type response = + [ `Error of string | `Expr of response_expr | `Graphviz of string ] [@@deriving to_yojson { exn = true }] let%expect_test _ = @@ -55,7 +56,8 @@ let handle_request { expr; command } : response = | `Parse -> expr_response expr | `StepCBN -> expr_response (step_with Eval.find_redex_cbn expr) | `StepCBV -> expr_response (step_with Eval.find_redex_cbv expr) - | `DrawTree | `RunCBN | `RunCBV -> failwith "not implemented" + | `DrawTree -> `Graphviz (Draw_tree.draw_tree expr) + | `RunCBN | `RunCBV -> failwith "not implemented" with | Failure msg -> `Error msg | exn -> `Error ("uncaught exception: " ^ Printexc.to_string exn) |