Skip to content

Commit

Permalink
remove old V module inside Concrete
Browse files Browse the repository at this point in the history
  • Loading branch information
zapashcanon committed Sep 17, 2023
1 parent 44d9e26 commit d36965a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 75 deletions.
74 changes: 0 additions & 74 deletions src/concrete.ml
Original file line number Diff line number Diff line change
Expand Up @@ -2,80 +2,6 @@
(* Copyright © 2021 Léo Andrès *)
(* Copyright © 2021 Pierre Chambart *)

module V :
Value_intf.T
with type vbool = Bool.t
and type int32 = Int32.t
and type int64 = Int64.t
and type float32 = Float32.t
and type float64 = Float64.t
and type ref_value = Concrete_value.ref_value
and type t = Concrete_value.t = struct
type vbool = bool

type int32 = Int32.t

type int64 = Int64.t

type float32 = Float32.t

type float64 = Float64.t

let const_i32 x = x

let const_i64 x = x

let const_f32 x = x

let const_f64 x = x

include Concrete_value

module Ref = struct
let get_func (r : ref_value) : Func_intf.t Value_intf.get_ref =
match r with
| Funcref (Some f) -> Ref_value f
| Funcref None -> Null
| _ -> Type_mismatch
end

module Bool = struct
let const c = c

let not = not

let and_ = ( && )

let or_ = ( || )

let int32 = function true -> 1l | false -> 0l

let pp = Format.pp_print_bool
end

module I32 = struct
include Int32
include Convert.Int32

let to_bool i = Int32.ne i 0l
end

module I64 = struct
include Int64
include Convert.Int64
end

module F32 = struct
include Float32
include Convert.Float32
end

module F64 = struct
include Float64
include Convert.Float64
end
end

module P = struct
module Extern_func = Concrete_value.Func
module Value = V
Expand Down
2 changes: 1 addition & 1 deletion src/script.ml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ let compare_result_const result (const : Concrete_value.t) =
Log.debug "TODO (Script.compare_result_const)@\n";
false

let value_of_const : Text.const -> Concrete.V.t Result.t = function
let value_of_const : Text.const -> V.t Result.t = function
| Const_I32 v -> ok @@ Concrete_value.I32 v
| Const_I64 v -> ok @@ Concrete_value.I64 v
| Const_F32 v -> ok @@ Concrete_value.F32 v
Expand Down

0 comments on commit d36965a

Please sign in to comment.