From 34c279ec2ede2b2cc6920d18a9cc1c71ff664d11 Mon Sep 17 00:00:00 2001 From: Moritz Gmeiner Date: Wed, 28 Aug 2024 23:36:56 +0200 Subject: [PATCH] removed show from lox_value --- lib/loxstd.ml | 3 ++- lib/value.ml | 5 +---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/loxstd.ml b/lib/loxstd.ml index d981164..033ecae 100644 --- a/lib/loxstd.ml +++ b/lib/loxstd.ml @@ -16,7 +16,8 @@ let exit : native_function = match n with | Number n when Float.is_integer n -> Int.of_float n |> exit | _ -> - Printf.sprintf "Must call exit with integer, received %s instead" (show_lox_value n) + Printf.sprintf "Must call exit with integer, received %s instead" + (string_of_lox_value n) |> Result.error) | _ -> assert false in diff --git a/lib/value.ml b/lib/value.ml index b4cf40d..1ba4e21 100644 --- a/lib/value.ml +++ b/lib/value.ml @@ -1,18 +1,16 @@ type lox_function = { name : string; arity : int; - (* env : Environment.environment; *) + (* env : Environment.environment; [@printer fun fmt _ -> fprintf fmt ""] *) arg_names : string list; body : Stmt.stmt_node; [@printer fun fmt _ -> fprintf fmt ""] } -[@@deriving show { with_path = false }] type native_function = { name : string; arity : int; fn : lox_value list -> (lox_value, string) result; } -[@@deriving show { with_path = false }] and lox_value = | Function of lox_function @@ -21,7 +19,6 @@ and lox_value = | Number of float | Bool of bool | Nil -[@@deriving show { with_path = false }] let string_of_lox_value lox_value = match lox_value with