Skip to content

Commit 9ae6216

Browse files
Remove left-over mentions of tuple and variant
1 parent b8561df commit 9ae6216

File tree

14 files changed

+9
-51
lines changed

14 files changed

+9
-51
lines changed

CHANGES.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
- Removed support for Tuple and Variant in JSON. It was a non-standard
1818
extension that was rarely used, so this simplifies the Yojson types and the
19-
parser more standard-conforming (#105, #158 @Leonidas-from-XIV)
19+
parser more standard-conforming (#105, #158, #185 @Leonidas-from-XIV)
2020

2121
### Security
2222

bin/ydump.ml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,7 @@ let parse_cmdline () =
7373
( "-std",
7474
Arg.Set std,
7575
"\n\
76-
\ Convert tuples and variants into standard JSON,\n\
77-
\ refuse to print NaN and infinities,\n\
76+
\ Refuse to print NaN and infinities,\n\
7877
\ require the root node to be either an object or an array." );
7978
( "-c",
8079
Arg.Set compact,

doc/index.mld

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ for efficiency purposes.
99
- Distinguishing between ints and floats.
1010
- Providing optional extensions of the JSON syntax.
1111
These extensions include comments, arbitrary strings,
12-
optional quotes around field names, tuples and variants.
12+
optional quotes around field names.
1313

1414
See {{:http://json.org}JSON specification}.
1515

lib/basic.cppo.mli

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
(**
2-
This module supports standard JSON nodes only, i.e. no special syntax
3-
for variants or tuples as supported by {!Yojson.Safe}.
2+
This module supports standard JSON nodes only.
43
Arbitrary integers are not supported as they must all fit within the
54
standard OCaml int type (31 or 63 bits depending on the platform).
65

lib/prettyprint.ml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,9 @@ let is_atom (x: [> t]) =
4343
| `Floatlit _
4444
| `Stringlit _
4545
| `List []
46-
| `Assoc []
47-
| `Tuple []
48-
| `Variant (_, None) -> true
46+
| `Assoc [] -> true
4947
| `List _
50-
| `Assoc _
51-
| `Tuple _
52-
| `Variant (_, Some _) -> false
48+
| `Assoc _ -> false
5349

5450
let is_atom_list l =
5551
List.for_all is_atom l

lib/raw.cppo.ml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
#define INTLIT
22
#define FLOATLIT
33
#define STRINGLIT
4-
#define TUPLE
5-
#define VARIANT
64

75
#include "type.ml"
86

@@ -25,5 +23,3 @@ end
2523
#undef INTLIT
2624
#undef FLOATLIT
2725
#undef STRINGLIT
28-
#undef TUPLE
29-
#undef VARIANT

lib/raw.cppo.mli

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
11
(**
22
Ints, floats and strings literals are systematically preserved using
33
[`Intlit], [`Floatlit] and [`Stringlit].
4-
This module also supports the specific syntax for variants and tuples
5-
supported by {!Yojson.Safe}.
64
*)
75

86
#define INTLIT
97
#define FLOATLIT
108
#define STRINGLIT
11-
#define TUPLE
12-
#define VARIANT
139

1410
#include "type.ml"
1511

@@ -29,5 +25,3 @@ end
2925
#undef INTLIT
3026
#undef FLOATLIT
3127
#undef STRINGLIT
32-
#undef TUPLE
33-
#undef VARIANT

lib/safe.cppo.ml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
#define INTLIT
33
#define FLOAT
44
#define STRING
5-
#define TUPLE
6-
#define VARIANT
75

86
#include "type.ml"
97

@@ -29,5 +27,3 @@ end
2927
#undef INTLIT
3028
#undef FLOAT
3129
#undef STRING
32-
#undef TUPLE
33-
#undef VARIANT

lib/safe.cppo.mli

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,17 @@
11
(**
2-
This module supports a specific syntax for variants and tuples
3-
in addition to the standard JSON nodes.
2+
This module supports a slight superset of the standard JSON nodes.
43
Arbitrary integers are supported and represented as a decimal string
54
using [`Intlit] when they cannot be represented using OCaml's int type
65
(31 or 63 bits depending on the platform).
76
8-
This module is recommended for intensive use
9-
or OCaml-friendly use of JSON.
7+
This module is recommended for intensive use or OCaml-friendly use of
8+
JSON.
109
*)
1110

1211
#define INT
1312
#define INTLIT
1413
#define FLOAT
1514
#define STRING
16-
#define TUPLE
17-
#define VARIANT
1815

1916
#include "type.ml"
2017

@@ -37,5 +34,3 @@ end
3734
#undef INTLIT
3835
#undef FLOAT
3936
#undef STRING
40-
#undef TUPLE
41-
#undef VARIANT

lib/safe_to_basic.mli

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,9 @@
11
val to_basic : t -> Basic.t
22
(**
3-
Tuples are converted to JSON arrays,
4-
Variants are converted to JSON strings or arrays of a string (constructor)
5-
and a json value (argument).
63
Long integers are converted to JSON strings.
74
85
Examples:
96
{v
10-
`Tuple [ `Int 1; `Float 2.3 ] -> `List [ `Int 1; `Float 2.3 ]
11-
`Variant ("A", None) -> `String "A"
12-
`Variant ("B", Some x) -> `List [ `String "B", x ]
137
`Intlit "12345678901234567890" -> `String "12345678901234567890"
148
v}
159
*)

0 commit comments

Comments
 (0)