removed show from lox_value

This commit is contained in:
Moritz Gmeiner 2024-08-28 23:36:56 +02:00
commit 34c279ec2e
2 changed files with 3 additions and 5 deletions

View file

@ -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

View file

@ -1,18 +1,16 @@
type lox_function = {
name : string;
arity : int;
(* env : Environment.environment; *)
(* env : Environment.environment; [@printer fun fmt _ -> fprintf fmt "<env>"] *)
arg_names : string list;
body : Stmt.stmt_node; [@printer fun fmt _ -> fprintf fmt "<body>"]
}
[@@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