mirror of
https://github.com/MorizzG/MLox.git
synced 2025-12-06 04:22:41 +00:00
removed show from lox_value
This commit is contained in:
parent
dee73dea20
commit
34c279ec2e
2 changed files with 3 additions and 5 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue