camlspotter avatar camlspotter committed d384a77

1.4.0

Comments (0)

Files changed (11)

+1.4.0
+--------------
+
+- based on meta_conv 1.1.1 and tiny_json 1.1.0
+- number decoding is now done in this library, not in tiny_json
+
 1.3.0
 --------------
 
 OASISFormat: 0.2
 Name:        tiny_json_conv
-Version:     1.3.0
+Version:     1.4.0
 Synopsis:    Meta conv for Tiny Json
 Authors:     Jun FURUSE
 License:     LGPL-2.0 with OCaml linking exception
 XCustomBuild: yes no | omake --install; PREFIX=$prefix omake
 XCustomInstall: PREFIX=$prefix omake install
 XCustomUninstall: PREFIX=$prefix omake uninstall
+XCustomBuildClean: PREFIX=$prefix omake clean
 BuildTools: omake
 name="tiny_json_conv"
-version="1.3.0"
+version="1.4.0"
 description="Meta conv for Tiny Json"
-requires="tiny_json, meta_conv"
+requires="tiny_json, meta_conv, num"
 archive(byte)="tiny_json_conv.cma"
 archive(native)="tiny_json_conv.cmxa"
 linkopts = ""
 name="tiny_json_conv"
 version="@version@"
 description="Meta conv for Tiny Json"
-requires="tiny_json, meta_conv"
+requires="tiny_json, meta_conv, num"
 archive(byte)="tiny_json_conv.cma"
 archive(native)="tiny_json_conv.cmxa"
 linkopts = ""
 OCAMLFLAGS    = -annot -w Ae
 
 OCAMLPACKS[]=
+    num
     tiny_json
     meta_conv
 
   end
 end)
 
-let json_of_int n       = Number (float n)
-let json_of_int32 n     = Number (Int32.to_float n)
-let json_of_int64 n     = Number (Int64.to_float n)
-let json_of_nativeint n = Number (Nativeint.to_float n)
+let json_of_int n       = Number (string_of_int n)
+let json_of_int32 n     = Number (Int32.to_string n)
+let json_of_int64 n     = Number (Int64.to_string n)
+let json_of_nativeint n = Number (Nativeint.to_string n)
 let json_of_char c      = String (String.make 1 c)
 let json_of_string s    = String s
-let json_of_float n     = Number n
+let json_of_float n     = Number (string_of_float n)
 let json_of_list f xs   = Array (List.map f xs)
 let json_of_array f xs  = Array (List.map f (Array.to_list xs))
 let json_of_bool b      = Bool b
   | String s when String.length s = 1 -> s.[0]
   | _ -> errorf "char_of_json: a char expected")
 
-let int_check name min max conv = Helper.of_deconstr (function 
-  | Number n -> 
-      begin match Helper.integer_of_float min max conv n with
-      | `Ok v -> v
-      | `Error s -> errorff "%s_of_json: %s" name s
-      end
+let int_check name conv = Helper.of_deconstr (function 
+  | Number s -> 
+      let bi = Big_int.big_int_of_string s in
+      begin try conv bi with Failure _ -> errorff "%s_of_json: overflow" name end
   | _ -> errorff "%s_of_json: Number expected" name)
 
 let int_of_json =
-  int_check "int" (float min_int) (float max_int) int_of_float
+  int_check "int" Big_int.int_of_big_int
 
 let int64_of_json =
-  let open Int64 in
-  int_check "int64" (to_float min_int) (to_float max_int) of_float
+  int_check "int64" Big_int.int64_of_big_int
       
 let int32_of_json =
-  let open Int32 in
-  int_check "int32" (to_float min_int) (to_float max_int) of_float
+  int_check "int32" Big_int.int32_of_big_int
       
 let nativeint_of_json = 
-  let open Nativeint in
-  int_check "nativeint" (to_float min_int) (to_float max_int) of_float
+  int_check "nativeint" Big_int.nativeint_of_big_int
       
 let float_of_json = Helper.of_deconstr (function
-  | Number n -> n
+  | Number s -> float_of_string s (* CR jfuruse: Maybe wrong *)
   | _ -> errorf "float_of_json: Number expected")
 
 let bool_of_json = Helper.of_deconstr (function

opam/template/opam

 ocaml-version: [>= "4.0.0"]
-depends: ["ocamlfind" "omake" "tiny_json" {>="1.0.0"} "meta_conv" {>="1.1.0"}]
+depends: ["ocamlfind" "omake" "tiny_json" {>="1.1.0"} "meta_conv" {>="1.1.1"}]

opam/tiny_json_conv.1.4.0/descr

+Meta conv for Tiny Json
+Converters for meta_conv + tiny_json

opam/tiny_json_conv.1.4.0/opam

+opam-version: "1"
+maintainer: "jun.furuse@gmail.com"
+build: [
+  ["ocaml" "setup.ml" "-configure" "--prefix" "%{prefix}%"]
+  ["ocaml" "setup.ml" "-build"]
+  ["ocaml" "setup.ml" "-install"]
+]
+remove: [
+  ["ocaml" "setup.ml" "-uninstall"]
+]
+ocaml-version: [>= "4.0.0"]
+depends: ["ocamlfind" "omake" "tiny_json" {>="1.1.0"} "meta_conv" {>="1.1.1"}]

opam/tiny_json_conv.1.4.0/url

+archive: "https://bitbucket.org/camlspotter/tiny_json_conv/get/1.4.0.tar.gz"
 (* setup.ml generated for the first time by OASIS v0.3.0 *)
 
 (* OASIS_START *)
-(* DO NOT EDIT (digest: 886ad4e73e79d568deefc1464811fc1a) *)
+(* DO NOT EDIT (digest: 6ed5810190a866ad4227b9502c96dff8) *)
 (*
    Regenerated by OASIS v0.3.0
    Visit http://oasis.forge.ocamlcore.org for more information and
    documentation about functions used in this file.
 *)
 module OASISGettext = struct
-# 21 "/somewhere/.opam/system/build/oasis.0.3.0/src/oasis/OASISGettext.ml"
+(* # 21 "/somewhere/.share/projects/externals/oasis/_build/src/oasis/OASISGettext.ml" *)
 
   let ns_ str =
     str
 end
 
 module OASISContext = struct
-# 21 "/somewhere/.opam/system/build/oasis.0.3.0/src/oasis/OASISContext.ml"
+(* # 21 "/somewhere/.share/projects/externals/oasis/_build/src/oasis/OASISContext.ml" *)
 
   open OASISGettext
 
 end
 
 module OASISString = struct
-# 1 "/somewhere/.opam/system/build/oasis.0.3.0/src/oasis/OASISString.ml"
+(* # 1 "/somewhere/.share/projects/externals/oasis/_build/src/oasis/OASISString.ml" *)
 
 
 
 end
 
 module OASISUtils = struct
-# 21 "/somewhere/.opam/system/build/oasis.0.3.0/src/oasis/OASISUtils.ml"
+(* # 21 "/somewhere/.share/projects/externals/oasis/_build/src/oasis/OASISUtils.ml" *)
 
   open OASISGettext
 
 end
 
 module PropList = struct
-# 21 "/somewhere/.opam/system/build/oasis.0.3.0/src/oasis/PropList.ml"
+(* # 21 "/somewhere/.share/projects/externals/oasis/_build/src/oasis/PropList.ml" *)
 
   open OASISGettext
 
     let clear t =
       Hashtbl.clear t
 
-# 71 "/somewhere/.opam/system/build/oasis.0.3.0/src/oasis/PropList.ml"
+(* # 71 "/somewhere/.share/projects/externals/oasis/_build/src/oasis/PropList.ml" *)
   end
 
   module Schema =
 end
 
 module OASISMessage = struct
-# 21 "/somewhere/.opam/system/build/oasis.0.3.0/src/oasis/OASISMessage.ml"
+(* # 21 "/somewhere/.share/projects/externals/oasis/_build/src/oasis/OASISMessage.ml" *)
 
 
   open OASISGettext
 end
 
 module OASISVersion = struct
-# 21 "/somewhere/.opam/system/build/oasis.0.3.0/src/oasis/OASISVersion.ml"
+(* # 21 "/somewhere/.share/projects/externals/oasis/_build/src/oasis/OASISVersion.ml" *)
 
   open OASISGettext
 
 end
 
 module OASISLicense = struct
-# 21 "/somewhere/.opam/system/build/oasis.0.3.0/src/oasis/OASISLicense.ml"
+(* # 21 "/somewhere/.share/projects/externals/oasis/_build/src/oasis/OASISLicense.ml" *)
 
   (** License for _oasis fields
       @author Sylvain Le Gall
 end
 
 module OASISExpr = struct
-# 21 "/somewhere/.opam/system/build/oasis.0.3.0/src/oasis/OASISExpr.ml"
+(* # 21 "/somewhere/.share/projects/externals/oasis/_build/src/oasis/OASISExpr.ml" *)
 
 
 
 end
 
 module OASISTypes = struct
-# 21 "/somewhere/.opam/system/build/oasis.0.3.0/src/oasis/OASISTypes.ml"
+(* # 21 "/somewhere/.share/projects/externals/oasis/_build/src/oasis/OASISTypes.ml" *)
 
 
 
 
   type plugin_data = (all_plugin * plugin_data_purpose * (unit -> unit)) list
 
-# 102 "/somewhere/.opam/system/build/oasis.0.3.0/src/oasis/OASISTypes.ml"
+(* # 102 "/somewhere/.share/projects/externals/oasis/_build/src/oasis/OASISTypes.ml" *)
 
   type 'a conditional = 'a OASISExpr.choices 
 
 end
 
 module OASISUnixPath = struct
-# 21 "/somewhere/.opam/system/build/oasis.0.3.0/src/oasis/OASISUnixPath.ml"
+(* # 21 "/somewhere/.share/projects/externals/oasis/_build/src/oasis/OASISUnixPath.ml" *)
 
   type unix_filename = string
   type unix_dirname = string
 end
 
 module OASISHostPath = struct
-# 21 "/somewhere/.opam/system/build/oasis.0.3.0/src/oasis/OASISHostPath.ml"
+(* # 21 "/somewhere/.share/projects/externals/oasis/_build/src/oasis/OASISHostPath.ml" *)
 
 
   open Filename
 end
 
 module OASISSection = struct
-# 21 "/somewhere/.opam/system/build/oasis.0.3.0/src/oasis/OASISSection.ml"
+(* # 21 "/somewhere/.share/projects/externals/oasis/_build/src/oasis/OASISSection.ml" *)
 
   open OASISTypes
 
 end
 
 module OASISBuildSection = struct
-# 21 "/somewhere/.opam/system/build/oasis.0.3.0/src/oasis/OASISBuildSection.ml"
+(* # 21 "/somewhere/.share/projects/externals/oasis/_build/src/oasis/OASISBuildSection.ml" *)
 
 end
 
 module OASISExecutable = struct
-# 21 "/somewhere/.opam/system/build/oasis.0.3.0/src/oasis/OASISExecutable.ml"
+(* # 21 "/somewhere/.share/projects/externals/oasis/_build/src/oasis/OASISExecutable.ml" *)
 
   open OASISTypes
 
 end
 
 module OASISLibrary = struct
-# 21 "/somewhere/.opam/system/build/oasis.0.3.0/src/oasis/OASISLibrary.ml"
+(* # 21 "/somewhere/.share/projects/externals/oasis/_build/src/oasis/OASISLibrary.ml" *)
 
   open OASISTypes
   open OASISUtils
 end
 
 module OASISFlag = struct
-# 21 "/somewhere/.opam/system/build/oasis.0.3.0/src/oasis/OASISFlag.ml"
+(* # 21 "/somewhere/.share/projects/externals/oasis/_build/src/oasis/OASISFlag.ml" *)
 
 end
 
 module OASISPackage = struct
-# 21 "/somewhere/.opam/system/build/oasis.0.3.0/src/oasis/OASISPackage.ml"
+(* # 21 "/somewhere/.share/projects/externals/oasis/_build/src/oasis/OASISPackage.ml" *)
 
 end
 
 module OASISSourceRepository = struct
-# 21 "/somewhere/.opam/system/build/oasis.0.3.0/src/oasis/OASISSourceRepository.ml"
+(* # 21 "/somewhere/.share/projects/externals/oasis/_build/src/oasis/OASISSourceRepository.ml" *)
 
 end
 
 module OASISTest = struct
-# 21 "/somewhere/.opam/system/build/oasis.0.3.0/src/oasis/OASISTest.ml"
+(* # 21 "/somewhere/.share/projects/externals/oasis/_build/src/oasis/OASISTest.ml" *)
 
 end
 
 module OASISDocument = struct
-# 21 "/somewhere/.opam/system/build/oasis.0.3.0/src/oasis/OASISDocument.ml"
+(* # 21 "/somewhere/.share/projects/externals/oasis/_build/src/oasis/OASISDocument.ml" *)
 
 end
 
 module OASISExec = struct
-# 21 "/somewhere/.opam/system/build/oasis.0.3.0/src/oasis/OASISExec.ml"
+(* # 21 "/somewhere/.share/projects/externals/oasis/_build/src/oasis/OASISExec.ml" *)
 
   open OASISGettext
   open OASISUtils
 end
 
 module OASISFileUtil = struct
-# 21 "/somewhere/.opam/system/build/oasis.0.3.0/src/oasis/OASISFileUtil.ml"
+(* # 21 "/somewhere/.share/projects/externals/oasis/_build/src/oasis/OASISFileUtil.ml" *)
 
   open OASISGettext
 
 
 # 2142 "setup.ml"
 module BaseEnvLight = struct
-# 21 "/somewhere/.opam/system/build/oasis.0.3.0/src/base/BaseEnvLight.ml"
+(* # 21 "/somewhere/.share/projects/externals/oasis/_build/src/base/BaseEnvLight.ml" *)
 
   module MapString = Map.Make(String)
 
 
 # 2240 "setup.ml"
 module BaseContext = struct
-# 21 "/somewhere/.opam/system/build/oasis.0.3.0/src/base/BaseContext.ml"
+(* # 21 "/somewhere/.share/projects/externals/oasis/_build/src/base/BaseContext.ml" *)
 
   open OASISContext
 
 end
 
 module BaseMessage = struct
-# 21 "/somewhere/.opam/system/build/oasis.0.3.0/src/base/BaseMessage.ml"
+(* # 21 "/somewhere/.share/projects/externals/oasis/_build/src/base/BaseMessage.ml" *)
 
   (** Message to user, overrid for Base
       @author Sylvain Le Gall
 end
 
 module BaseEnv = struct
-# 21 "/somewhere/.opam/system/build/oasis.0.3.0/src/base/BaseEnv.ml"
+(* # 21 "/somewhere/.share/projects/externals/oasis/_build/src/base/BaseEnv.ml" *)
 
   open OASISGettext
   open OASISUtils
 end
 
 module BaseArgExt = struct
-# 21 "/somewhere/.opam/system/build/oasis.0.3.0/src/base/BaseArgExt.ml"
+(* # 21 "/somewhere/.share/projects/externals/oasis/_build/src/base/BaseArgExt.ml" *)
 
   open OASISUtils
   open OASISGettext
 end
 
 module BaseCheck = struct
-# 21 "/somewhere/.opam/system/build/oasis.0.3.0/src/base/BaseCheck.ml"
+(* # 21 "/somewhere/.share/projects/externals/oasis/_build/src/base/BaseCheck.ml" *)
 
   open BaseEnv
   open BaseMessage
 end
 
 module BaseOCamlcConfig = struct
-# 21 "/somewhere/.opam/system/build/oasis.0.3.0/src/base/BaseOCamlcConfig.ml"
+(* # 21 "/somewhere/.share/projects/externals/oasis/_build/src/base/BaseOCamlcConfig.ml" *)
 
 
   open BaseEnv
 end
 
 module BaseStandardVar = struct
-# 21 "/somewhere/.opam/system/build/oasis.0.3.0/src/base/BaseStandardVar.ml"
+(* # 21 "/somewhere/.share/projects/externals/oasis/_build/src/base/BaseStandardVar.ml" *)
 
 
   open OASISGettext
 end
 
 module BaseFileAB = struct
-# 21 "/somewhere/.opam/system/build/oasis.0.3.0/src/base/BaseFileAB.ml"
+(* # 21 "/somewhere/.share/projects/externals/oasis/_build/src/base/BaseFileAB.ml" *)
 
   open BaseEnv
   open OASISGettext
 end
 
 module BaseLog = struct
-# 21 "/somewhere/.opam/system/build/oasis.0.3.0/src/base/BaseLog.ml"
+(* # 21 "/somewhere/.share/projects/externals/oasis/_build/src/base/BaseLog.ml" *)
 
   open OASISUtils
 
 end
 
 module BaseBuilt = struct
-# 21 "/somewhere/.opam/system/build/oasis.0.3.0/src/base/BaseBuilt.ml"
+(* # 21 "/somewhere/.share/projects/externals/oasis/_build/src/base/BaseBuilt.ml" *)
 
   open OASISTypes
   open OASISGettext
 end
 
 module BaseCustom = struct
-# 21 "/somewhere/.opam/system/build/oasis.0.3.0/src/base/BaseCustom.ml"
+(* # 21 "/somewhere/.share/projects/externals/oasis/_build/src/base/BaseCustom.ml" *)
 
   open BaseEnv
   open BaseMessage
 end
 
 module BaseDynVar = struct
-# 21 "/somewhere/.opam/system/build/oasis.0.3.0/src/base/BaseDynVar.ml"
+(* # 21 "/somewhere/.share/projects/externals/oasis/_build/src/base/BaseDynVar.ml" *)
 
 
   open OASISTypes
 end
 
 module BaseTest = struct
-# 21 "/somewhere/.opam/system/build/oasis.0.3.0/src/base/BaseTest.ml"
+(* # 21 "/somewhere/.share/projects/externals/oasis/_build/src/base/BaseTest.ml" *)
 
   open BaseEnv
   open BaseMessage
 end
 
 module BaseDoc = struct
-# 21 "/somewhere/.opam/system/build/oasis.0.3.0/src/base/BaseDoc.ml"
+(* # 21 "/somewhere/.share/projects/externals/oasis/_build/src/base/BaseDoc.ml" *)
 
   open BaseEnv
   open BaseMessage
 end
 
 module BaseSetup = struct
-# 21 "/somewhere/.opam/system/build/oasis.0.3.0/src/base/BaseSetup.ml"
+(* # 21 "/somewhere/.share/projects/externals/oasis/_build/src/base/BaseSetup.ml" *)
 
   open BaseEnv
   open BaseMessage
 
 # 4480 "setup.ml"
 module InternalConfigurePlugin = struct
-# 21 "/somewhere/.opam/system/build/oasis.0.3.0/src/plugins/internal/InternalConfigurePlugin.ml"
+(* # 21 "/somewhere/.share/projects/externals/oasis/_build/src/plugins/internal/InternalConfigurePlugin.ml" *)
 
   (** Configure using internal scheme
       @author Sylvain Le Gall
 end
 
 module InternalInstallPlugin = struct
-# 21 "/somewhere/.opam/system/build/oasis.0.3.0/src/plugins/internal/InternalInstallPlugin.ml"
+(* # 21 "/somewhere/.share/projects/externals/oasis/_build/src/plugins/internal/InternalInstallPlugin.ml" *)
 
   (** Install using internal scheme
       @author Sylvain Le Gall
 
 # 5233 "setup.ml"
 module CustomPlugin = struct
-# 21 "/somewhere/.opam/system/build/oasis.0.3.0/src/plugins/custom/CustomPlugin.ml"
+(* # 21 "/somewhere/.share/projects/externals/oasis/_build/src/plugins/custom/CustomPlugin.ml" *)
 
   (** Generate custom configure/build/doc/test/install system
       @author
                         "omake"
                      ]))
               ];
-            cmd_clean = [(OASISExpr.EBool true, None)];
+            cmd_clean =
+              [
+                 (OASISExpr.EBool true,
+                   Some (("PREFIX=$prefix", ["omake"; "clean"])))
+              ];
             cmd_distclean = [(OASISExpr.EBool true, None)];
             };
      test = [];
                            "omake"
                         ]))
                  ];
-               cmd_clean = [(OASISExpr.EBool true, None)];
+               cmd_clean =
+                 [
+                    (OASISExpr.EBool true,
+                      Some (("PREFIX=$prefix", ["omake"; "clean"])))
+                 ];
                cmd_distclean = [(OASISExpr.EBool true, None)];
                };
           CustomPlugin.clean
                            "omake"
                         ]))
                  ];
-               cmd_clean = [(OASISExpr.EBool true, None)];
+               cmd_clean =
+                 [
+                    (OASISExpr.EBool true,
+                      Some (("PREFIX=$prefix", ["omake"; "clean"])))
+                 ];
                cmd_distclean = [(OASISExpr.EBool true, None)];
                };
           CustomPlugin.distclean
           ocaml_version = None;
           findlib_version = None;
           name = "tiny_json_conv";
-          version = "1.3.0";
+          version = "1.4.0";
           license =
             OASISLicense.DEP5License
               (OASISLicense.DEP5Unit
           };
      oasis_fn = Some "_oasis";
      oasis_version = "0.3.0";
-     oasis_digest = Some "(\015@\152i\151\131/x%L\237g\0316U";
+     oasis_digest = Some "1R**\209^c\142!\178\195p\185\128!\031";
      oasis_exec = None;
      oasis_setup_args = [];
      setup_update = false;
 
 let setup () = BaseSetup.setup setup_t;;
 
-# 5577 "setup.ml"
+# 5589 "setup.ml"
 (* OASIS_STOP *)
 let () = setup ();;
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.