-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move
Safe
, Basic
and Raw
into their own modules
- Loading branch information
1 parent
95e8d0f
commit 1ead566
Showing
16 changed files
with
333 additions
and
254 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,6 @@ | |
lib/*.cppo.ml* | ||
lib/monomorphic.ml | ||
lib/write.ml* | ||
lib/pretty.ml | ||
lib/prettyprint.ml | ||
lib/type.ml | ||
lib/util.ml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#define INT | ||
#define FLOAT | ||
#define STRING | ||
#include "type.ml" | ||
#include "write.ml" | ||
module Pretty = | ||
struct | ||
#include "prettyprint.ml" | ||
end | ||
#include "monomorphic.ml" | ||
#include "write2.ml" | ||
#include "read.ml" | ||
module Util = | ||
struct | ||
#include "util.ml" | ||
end | ||
#undef INT | ||
#undef FLOAT | ||
#undef STRING |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
(** | ||
This module supports standard JSON nodes only, i.e. no special syntax | ||
for variants or tuples as supported by {!Yojson.Safe}. | ||
Arbitrary integers are not supported as they must all fit within the | ||
standard OCaml int type (31 or 63 bits depending on the platform). | ||
The main advantage of this module is its simplicity. | ||
*) | ||
|
||
#define INT | ||
#define FLOAT | ||
#define STRING | ||
#include "type.ml" | ||
#include "write.mli" | ||
#include "monomorphic.mli" | ||
#include "write2.mli" | ||
#include "read.mli" | ||
(** This module provides combinators for extracting fields from JSON values. *) | ||
module Util : | ||
sig | ||
#include "util.mli" | ||
end | ||
#undef INT | ||
#undef FLOAT | ||
#undef STRING |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#define INTLIT | ||
#define FLOATLIT | ||
#define STRINGLIT | ||
#define TUPLE | ||
#define VARIANT | ||
#include "type.ml" | ||
#include "write.ml" | ||
module Pretty = | ||
struct | ||
#include "prettyprint.ml" | ||
end | ||
#include "monomorphic.ml" | ||
#include "write2.ml" | ||
#include "read.ml" | ||
module Util = | ||
struct | ||
#include "util.ml" | ||
end | ||
#undef INTLIT | ||
#undef FLOATLIT | ||
#undef STRINGLIT | ||
#undef TUPLE | ||
#undef VARIANT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
(** | ||
Ints, floats and strings literals are systematically preserved using | ||
[`Intlit], [`Floatlit] and [`Stringlit]. | ||
This module also supports the specific syntax for variants and tuples | ||
supported by {!Yojson.Safe}. | ||
*) | ||
|
||
#define INTLIT | ||
#define FLOATLIT | ||
#define STRINGLIT | ||
#define TUPLE | ||
#define VARIANT | ||
#include "type.ml" | ||
#include "monomorphic.mli" | ||
#include "write.mli" | ||
#include "write2.mli" | ||
#include "read.mli" | ||
(** This module provides combinators for extracting fields from JSON values. *) | ||
module Util : | ||
sig | ||
#include "util.mli" | ||
end | ||
#undef INTLIT | ||
#undef FLOATLIT | ||
#undef STRINGLIT | ||
#undef TUPLE | ||
#undef VARIANT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#define INT | ||
#define INTLIT | ||
#define FLOAT | ||
#define STRING | ||
#define TUPLE | ||
#define VARIANT | ||
#include "type.ml" | ||
#include "safe_convert.ml" | ||
#include "write.ml" | ||
module Pretty = | ||
struct | ||
#include "prettyprint.ml" | ||
end | ||
#include "monomorphic.ml" | ||
#include "write2.ml" | ||
#include "read.ml" | ||
module Util = | ||
struct | ||
#include "util.ml" | ||
end | ||
#undef INT | ||
#undef INTLIT | ||
#undef FLOAT | ||
#undef STRING | ||
#undef TUPLE | ||
#undef VARIANT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
(** | ||
This module supports a specific syntax for variants and tuples | ||
in addition to the standard JSON nodes. | ||
Arbitrary integers are supported and represented as a decimal string | ||
using [`Intlit] when they cannot be represented using OCaml's int type | ||
(31 or 63 bits depending on the platform). | ||
This module is recommended for intensive use | ||
or OCaml-friendly use of JSON. | ||
*) | ||
|
||
#define INT | ||
#define INTLIT | ||
#define FLOAT | ||
#define STRING | ||
#define TUPLE | ||
#define VARIANT | ||
#include "type.ml" | ||
#include "monomorphic.mli" | ||
#include "safe_convert.mli" | ||
#include "write.mli" | ||
#include "write2.mli" | ||
#include "read.mli" | ||
(** This module provides combinators for extracting fields from JSON values. *) | ||
module Util : | ||
sig | ||
#include "util.mli" | ||
end | ||
#undef INT | ||
#undef INTLIT | ||
#undef FLOAT | ||
#undef STRING | ||
#undef TUPLE | ||
#undef VARIANT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#define INT | ||
#define INTLIT | ||
#define FLOAT | ||
#define FLOATLIT | ||
#define STRING | ||
#define STRINGLIT | ||
#define TUPLE | ||
#define VARIANT | ||
#include "type.ml" | ||
#include "write.ml" | ||
#include "monomorphic.ml" | ||
module Pretty = | ||
struct | ||
#include "prettyprint.ml" | ||
end | ||
#include "write2.ml" | ||
#undef INT | ||
#undef INTLIT | ||
#undef FLOAT | ||
#undef FLOATLIT | ||
#undef STRING | ||
#undef STRINGLIT | ||
#undef TUPLE | ||
#undef VARIANT | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#define INT | ||
#define INTLIT | ||
#define FLOAT | ||
#define FLOATLIT | ||
#define STRING | ||
#define STRINGLIT | ||
#define TUPLE | ||
#define VARIANT | ||
#include "type.ml" | ||
#include "monomorphic.mli" | ||
#include "write.mli" | ||
#include "write2.mli" | ||
#undef INT | ||
#undef INTLIT | ||
#undef FLOAT | ||
#undef FLOATLIT | ||
#undef STRING | ||
#undef STRINGLIT | ||
#undef TUPLE | ||
#undef VARIANT |
Oops, something went wrong.