Permalink
Browse files

[enhance] opatop: updating to big_int

  • Loading branch information...
1 parent 81e2a87 commit 96f4e1407db13a55b1dc2969beecdc59d53fd28f @BourgerieQuentin BourgerieQuentin committed Aug 8, 2012
Showing with 9 additions and 5 deletions.
  1. +3 −0 compiler/jslang/jsCons.ml
  2. +1 −0 compiler/jslang/jsCons.mli
  3. +3 −3 compiler/opatop/opaTopValue.ml
  4. +2 −2 compiler/opatop/serverLib.ml
@@ -147,6 +147,9 @@ struct
let int ?(label=def_label()) int =
J.Je_num (label, string_of_int int)
+ let bint ?(label=def_label()) int =
+ J.Je_num (label, Big_int.string_of_big_int int)
+
let int_as_string ?(label=def_label()) int =
J.Je_num (label, int)
@@ -66,6 +66,7 @@ sig
val ident : ?label:Annot.label -> JsAst.ident -> JsAst.expr
val in_ : ?label:Annot.label -> JsAst.expr -> JsAst.expr -> JsAst.expr
val int : ?label:Annot.label -> int -> JsAst.expr
+ val bint : ?label:Annot.label -> Big_int.big_int -> JsAst.expr
val int_as_string : ?label:Annot.label -> string -> JsAst.expr
val land_ : ?label:Annot.label -> JsAst.expr -> JsAst.expr -> JsAst.expr
val list : ?label:Annot.label -> JsAst.expr list -> JsAst.expr
@@ -1,5 +1,5 @@
(*
- Copyright © 2011 MLstate
+ Copyright © 2011, 2012 MLstate
This file is part of Opa.
@@ -205,11 +205,11 @@ module Proj =
struct
module B = BslTypes
- let t_int ?(pos=nopos) i = V_const (pos, Q.Int i)
+ let t_int ?(pos=nopos) i = V_const (pos, Q.Int (Big_int.big_int_of_int i))
let t_float ?(pos=nopos) f = V_const (pos, Q.Float f)
let t_string ?(pos=nopos) s = V_const (pos, Q.String s)
let t_void ?(pos=nopos) () = V_record (pos, StringMap.empty, ref None)
- let t_int64 ?(pos=nopos) i = V_const (pos, Q.Int (Int64.to_int i))
+ let t_int64 ?(pos=nopos) i = V_const (pos, Q.Int (Big_int.big_int_of_int64 i))
let shared_void = t_void ()
let shared_lazy_void = Lazy.lazy_from_val shared_void
@@ -1,5 +1,5 @@
(*
- Copyright © 2011 MLstate
+ Copyright © 2011, 2012 MLstate
This file is part of Opa.
@@ -238,7 +238,7 @@ let unwrap_float = function
let wrap_int c = V.Proj.t_int c
let unwrap_int = function
- | V.V_const (_, Q.Int i) -> i
+ | V.V_const (_, Q.Int i) -> Big_int.int_of_big_int i
| t ->
fail t "SL.unwrap_int, expecting an int@\n"

0 comments on commit 96f4e14

Please sign in to comment.