From df5f3fd17e5b8bab84c5c712746ed91b5b730890 Mon Sep 17 00:00:00 2001 From: zapashcanon Date: Tue, 3 Dec 2024 11:04:17 +0100 Subject: [PATCH] fix bug in parsing of Num.t --- src/ast/num.ml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ast/num.ml b/src/ast/num.ml index 62989dd7..ba35482a 100644 --- a/src/ast/num.ml +++ b/src/ast/num.ml @@ -88,11 +88,11 @@ let of_string (cast : Ty.t) value = | Ty_fp 32 -> ( match float_of_string value with | None -> Error "invalid value, expected float" - | Some n -> Ok (I32 (Int32.bits_of_float n)) ) + | Some n -> Ok (F32 (Int32.bits_of_float n)) ) | Ty_fp 64 -> ( match float_of_string value with | None -> Error "invalid value, expected float" - | Some n -> Ok (I64 (Int64.bits_of_float n)) ) + | Some n -> Ok (F64 (Int64.bits_of_float n)) ) | _ -> Error "invalid value, expected num" let to_json (n : t) : Yojson.Basic.t = `String (to_string n)