You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
let write_rule_id_and_engine_kind : _ -> rule_id_and_engine_kind -> _ = (
6126
-
fun ob (x : rule_id_and_engine_kind) ->
6127
-
Bi_outbuf.add_char ob '{';
6128
-
let is_first = ref true in
6129
-
if !is_first then
6130
-
is_first := false
6131
-
else
6132
-
Bi_outbuf.add_char ob ',';
6133
-
Bi_outbuf.add_string ob "\"rule_id\":";
6122
+
let write_rule_id_and_engine_kind = (
6123
+
fun ob x ->
6124
+
Bi_outbuf.add_char ob '[';
6125
+
(let x, _ = x in
6134
6126
(
6135
6127
write_rule_id
6136
-
)
6137
-
ob x.rule_id;
6138
-
if !is_first then
6139
-
is_first := false
6140
-
else
6141
-
Bi_outbuf.add_char ob ',';
6142
-
Bi_outbuf.add_string ob "\"engine_kind\":";
6128
+
) ob x
6129
+
);
6130
+
Bi_outbuf.add_char ob ',';
6131
+
(let _, x = x in
6143
6132
(
6144
6133
write_engine_kind
6145
-
)
6146
-
ob x.engine_kind;
6147
-
Bi_outbuf.add_char ob '}';
6134
+
) ob x
6135
+
);
6136
+
Bi_outbuf.add_char ob ']';
6148
6137
)
6149
6138
let string_of_rule_id_and_engine_kind ?(len = 1024) x =
6150
6139
let ob = Bi_outbuf.create len in
@@ -6153,125 +6142,46 @@ let string_of_rule_id_and_engine_kind ?(len = 1024) x =
6153
6142
let read_rule_id_and_engine_kind = (
6154
6143
fun p lb ->
6155
6144
Yojson.Safe.read_space p lb;
6156
-
Yojson.Safe.read_lcurl p lb;
6157
-
let field_rule_id = ref (None) in
6158
-
let field_engine_kind = ref (None) in
6159
-
try
6160
-
Yojson.Safe.read_space p lb;
6161
-
Yojson.Safe.read_object_end lb;
6162
-
Yojson.Safe.read_space p lb;
6163
-
let f =
6164
-
fun s pos len ->
6165
-
if pos < 0 || len < 0 || pos + len > String.length s then
6166
-
invalid_arg "out-of-bounds substring position or length";
6167
-
match len with
6168
-
| 7 -> (
6169
-
if String.unsafe_get s pos = 'r' && String.unsafe_get s (pos+1) = 'u' && String.unsafe_get s (pos+2) = 'l' && String.unsafe_get s (pos+3) = 'e' && String.unsafe_get s (pos+4) = '_' && String.unsafe_get s (pos+5) = 'i' && String.unsafe_get s (pos+6) = 'd' then (
6170
-
0
6171
-
)
6172
-
else (
6173
-
-1
6174
-
)
6175
-
)
6176
-
| 11 -> (
6177
-
if String.unsafe_get s pos = 'e' && String.unsafe_get s (pos+1) = 'n' && String.unsafe_get s (pos+2) = 'g' && String.unsafe_get s (pos+3) = 'i' && String.unsafe_get s (pos+4) = 'n' && String.unsafe_get s (pos+5) = 'e' && String.unsafe_get s (pos+6) = '_' && String.unsafe_get s (pos+7) = 'k' && String.unsafe_get s (pos+8) = 'i' && String.unsafe_get s (pos+9) = 'n' && String.unsafe_get s (pos+10) = 'd' then (
6178
-
1
6179
-
)
6180
-
else (
6181
-
-1
6182
-
)
6183
-
)
6184
-
| _ -> (
6185
-
-1
6186
-
)
6187
-
in
6188
-
let i = Yojson.Safe.map_ident p f lb in
6189
-
Atdgen_runtime.Oj_run.read_until_field_value p lb;
6190
-
(
6191
-
match i with
6192
-
| 0 ->
6193
-
field_rule_id := (
6194
-
Some (
6195
-
(
6196
-
read_rule_id
6197
-
) p lb
6198
-
)
6199
-
);
6200
-
| 1 ->
6201
-
field_engine_kind := (
6202
-
Some (
6203
-
(
6204
-
read_engine_kind
6205
-
) p lb
6206
-
)
6207
-
);
6208
-
| _ -> (
6209
-
Yojson.Safe.skip_json p lb
6210
-
)
6211
-
);
6212
-
while true do
6213
-
Yojson.Safe.read_space p lb;
6214
-
Yojson.Safe.read_object_sep p lb;
6145
+
let std_tuple = Yojson.Safe.start_any_tuple p lb in
6146
+
let len = ref 0 in
6147
+
let end_of_tuple = ref false in
6148
+
(try
6149
+
let x0 =
6150
+
let x =
6151
+
(
6152
+
read_rule_id
6153
+
) p lb
6154
+
in
6155
+
incr len;
6215
6156
Yojson.Safe.read_space p lb;
6216
-
let f =
6217
-
fun s pos len ->
6218
-
if pos < 0 || len < 0 || pos + len > String.length s then
6219
-
invalid_arg "out-of-bounds substring position or length";
6220
-
match len with
6221
-
| 7 -> (
6222
-
if String.unsafe_get s pos = 'r' && String.unsafe_get s (pos+1) = 'u' && String.unsafe_get s (pos+2) = 'l' && String.unsafe_get s (pos+3) = 'e' && String.unsafe_get s (pos+4) = '_' && String.unsafe_get s (pos+5) = 'i' && String.unsafe_get s (pos+6) = 'd' then (
6223
-
0
6224
-
)
6225
-
else (
6226
-
-1
6227
-
)
6228
-
)
6229
-
| 11 -> (
6230
-
if String.unsafe_get s pos = 'e' && String.unsafe_get s (pos+1) = 'n' && String.unsafe_get s (pos+2) = 'g' && String.unsafe_get s (pos+3) = 'i' && String.unsafe_get s (pos+4) = 'n' && String.unsafe_get s (pos+5) = 'e' && String.unsafe_get s (pos+6) = '_' && String.unsafe_get s (pos+7) = 'k' && String.unsafe_get s (pos+8) = 'i' && String.unsafe_get s (pos+9) = 'n' && String.unsafe_get s (pos+10) = 'd' then (
6231
-
1
6232
-
)
6233
-
else (
6234
-
-1
6235
-
)
6236
-
)
6237
-
| _ -> (
6238
-
-1
6239
-
)
6157
+
Yojson.Safe.read_tuple_sep2 p std_tuple lb;
6158
+
x
6159
+
in
6160
+
let x1 =
6161
+
let x =
6162
+
(
6163
+
read_engine_kind
6164
+
) p lb
6240
6165
in
6241
-
let i = Yojson.Safe.map_ident p f lb in
6242
-
Atdgen_runtime.Oj_run.read_until_field_value p lb;
6243
-
(
6244
-
match i with
6245
-
| 0 ->
6246
-
field_rule_id := (
6247
-
Some (
6248
-
(
6249
-
read_rule_id
6250
-
) p lb
6251
-
)
6252
-
);
6253
-
| 1 ->
6254
-
field_engine_kind := (
6255
-
Some (
6256
-
(
6257
-
read_engine_kind
6258
-
) p lb
6259
-
)
6260
-
);
6261
-
| _ -> (
6262
-
Yojson.Safe.skip_json p lb
6263
-
)
6264
-
);
6265
-
done;
6266
-
assert false;
6267
-
with Yojson.End_of_object -> (
6268
-
(
6269
-
{
6270
-
rule_id = (match !field_rule_id with Some x -> x | None -> Atdgen_runtime.Oj_run.missing_field p "rule_id");
6271
-
engine_kind = (match !field_engine_kind with Some x -> x | None -> Atdgen_runtime.Oj_run.missing_field p "engine_kind");
6272
-
}
6273
-
: rule_id_and_engine_kind)
6274
-
)
6166
+
incr len;
6167
+
(try
6168
+
Yojson.Safe.read_space p lb;
6169
+
Yojson.Safe.read_tuple_sep2 p std_tuple lb;
6170
+
with Yojson.End_of_tuple -> end_of_tuple := true);
6171
+
x
6172
+
in
6173
+
if not !end_of_tuple then (
6174
+
try
6175
+
while true do
6176
+
Yojson.Safe.skip_json p lb;
6177
+
Yojson.Safe.read_space p lb;
6178
+
Yojson.Safe.read_tuple_sep2 p std_tuple lb;
6179
+
done
6180
+
with Yojson.End_of_tuple -> ()
6181
+
);
6182
+
(x0, x1)
6183
+
with Yojson.End_of_tuple ->
6184
+
Atdgen_runtime.Oj_run.missing_tuple_fields p !len [ 0; 1 ]);
0 commit comments