aboutsummaryrefslogtreecommitdiff
path: root/discocaml
diff options
context:
space:
mode:
Diffstat (limited to 'discocaml')
-rw-r--r--discocaml/ast.ml2
-rw-r--r--discocaml/discocaml.ml1
2 files changed, 2 insertions, 1 deletions
diff --git a/discocaml/ast.ml b/discocaml/ast.ml
index f3606cf..9436b69 100644
--- a/discocaml/ast.ml
+++ b/discocaml/ast.ml
@@ -7,7 +7,7 @@ let raise_unsupported_ast (type a) (f : Format.formatter -> a -> unit) (x : a) =
Format.pp_print_flush fmt ();
raise (UnsupportedAst (Buffer.contents buf))
-let raise_unsupported_expr = raise_unsupported_ast (Printast.expression 0)
+let raise_unsupported_expr = raise_unsupported_ast Pprintast.expression
type 'a index = { index : int } [@@deriving show { with_path = false }]
diff --git a/discocaml/discocaml.ml b/discocaml/discocaml.ml
index 676cd67..ba407c1 100644
--- a/discocaml/discocaml.ml
+++ b/discocaml/discocaml.ml
@@ -91,6 +91,7 @@ let handle_request { expr; command } : response =
run_with Eval.find_redex_cbv expr
|> Seq.take 100 |> Seq.map show_expr |> Array.of_seq )
with
+ | Ast.UnsupportedAst ast -> `Error ("unsupported AST: " ^ ast)
| Eval.NotARedex expr -> `Error ("not a redex: " ^ show_expr expr)
| Failure msg -> `Error msg
| exn -> `Error ("uncaught exception: " ^ Printexc.to_string exn)