Skip to content

Commit 8863c4c

Browse files
authored
Upgrade Core to 1257bcddc2797de7c95dedefebf6c2fb1e00717a (#874)
Signed-off-by: Juan Cruz Viotti <[email protected]>
1 parent d0f111b commit 8863c4c

File tree

83 files changed

+1265
-1323
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+1265
-1323
lines changed

DEPENDENCIES

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
vendorpull https://github.com/sourcemeta/vendorpull 70342aaf458e6cb80baeb5b718901075fc42ede6
2-
core https://github.com/sourcemeta/core 514001ace2da9444cfe2382a4134ed4cd773ce73
2+
core https://github.com/sourcemeta/core 1257bcddc2797de7c95dedefebf6c2fb1e00717a
33
bootstrap https://github.com/twbs/bootstrap 1a6fdfae6be09b09eaced8f0e442ca6f7680a61e

cmake/FindCore.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ if(NOT Core_FOUND)
88
set(SOURCEMETA_CORE_JSONL OFF CACHE BOOL "disable JSONL support")
99
set(SOURCEMETA_CORE_YAML OFF CACHE BOOL "disable YAML support")
1010
set(SOURCEMETA_CORE_CONTRIB_GOOGLETEST ${JSONBINPACK_TESTS} CACHE BOOL "GoogleTest")
11-
set(SOURCEMETA_CORE_CONTRIB_GOOGLEBENCHMARK ${JSONBINPACK_BENCHMARK} CACHE BOOL "GoogleBenchmark")
11+
set(SOURCEMETA_CORE_CONTRIB_GOOGLEBENCHMARK OFF CACHE BOOL "GoogleBenchmark")
1212
add_subdirectory("${PROJECT_SOURCE_DIR}/vendor/core")
1313
include(Sourcemeta)
1414
set(Core_FOUND ON)

src/compiler/encoding.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ inline auto make_resolver(const sourcemeta::core::SchemaResolver &fallback)
1313
return [&fallback](std::string_view identifier)
1414
-> std::optional<sourcemeta::core::JSON> {
1515
if (identifier == ENCODING_V1) {
16-
return sourcemeta::core::parse(R"JSON({
16+
return sourcemeta::core::parse_json(R"JSON({
1717
"$id": "tag:sourcemeta.com,2024:jsonbinpack/encoding/v1",
1818
"$schema": "https://json-schema.org/draft/2020-12/schema",
1919
"$vocabulary": {

src/compiler/include/sourcemeta/jsonbinpack/compiler.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@ namespace sourcemeta::jsonbinpack {
3434
///
3535
/// #include <iostream>
3636
///
37-
/// auto schema{sourcemeta::core::parse(R"JSON({
37+
/// auto schema{sourcemeta::core::parse_json(R"JSON({
3838
/// "$schema": "https://json-schema.org/draft/2020-12/schema",
3939
/// "type": "string"
4040
/// })JSON")};
4141
///
4242
/// sourcemeta::jsonbinpack::compile(
43-
/// schema, sourcemeta::core::default_schema_walker,
43+
/// schema, sourcemeta::core::schema_official_walker,
4444
/// sourcemeta::core::official_resolver);
4545
///
4646
/// sourcemeta::core::prettify(schema, std::cout);
@@ -67,13 +67,13 @@ auto compile(sourcemeta::core::JSON &schema,
6767
///
6868
/// #include <iostream>
6969
///
70-
/// auto schema{sourcemeta::core::parse(R"JSON({
70+
/// auto schema{sourcemeta::core::parse_json(R"JSON({
7171
/// "$schema": "https://json-schema.org/draft/2020-12/schema",
7272
/// "type": "string"
7373
/// })JSON")};
7474
///
7575
/// sourcemeta::jsonbinpack::canonicalize(
76-
/// schema, sourcemeta::core::default_schema_walker,
76+
/// schema, sourcemeta::core::schema_official_walker,
7777
/// sourcemeta::core::official_resolver);
7878
///
7979
/// sourcemeta::core::prettify(schema, std::cout);

test/compiler/2020_12_canonicalizer_any_test.cc

Lines changed: 63 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@
55
#include <sourcemeta/jsonbinpack/compiler.h>
66

77
TEST(JSONBinPack_Canonicalizer_Any_2020_12, if_without_then_else_1) {
8-
auto schema = sourcemeta::core::parse(R"JSON({
8+
auto schema = sourcemeta::core::parse_json(R"JSON({
99
"$schema": "https://json-schema.org/draft/2020-12/schema",
1010
"type": "object",
1111
"if": { "minProperties": 2 }
1212
})JSON");
1313

14-
sourcemeta::jsonbinpack::canonicalize(schema,
15-
sourcemeta::core::default_schema_walker,
16-
sourcemeta::core::official_resolver);
14+
sourcemeta::jsonbinpack::canonicalize(
15+
schema, sourcemeta::core::schema_official_walker,
16+
sourcemeta::core::official_resolver);
1717

18-
const auto expected = sourcemeta::core::parse(R"JSON({
18+
const auto expected = sourcemeta::core::parse_json(R"JSON({
1919
"$schema": "https://json-schema.org/draft/2020-12/schema",
2020
"type": "object",
2121
"minProperties": 0,
@@ -26,18 +26,18 @@ TEST(JSONBinPack_Canonicalizer_Any_2020_12, if_without_then_else_1) {
2626
}
2727

2828
TEST(JSONBinPack_Canonicalizer_Any_2020_12, then_else_without_if_1) {
29-
auto schema = sourcemeta::core::parse(R"JSON({
29+
auto schema = sourcemeta::core::parse_json(R"JSON({
3030
"$schema": "https://json-schema.org/draft/2020-12/schema",
3131
"type": "object",
3232
"then": { "minProperties": 2 },
3333
"else": { "minProperties": 3 }
3434
})JSON");
3535

36-
sourcemeta::jsonbinpack::canonicalize(schema,
37-
sourcemeta::core::default_schema_walker,
38-
sourcemeta::core::official_resolver);
36+
sourcemeta::jsonbinpack::canonicalize(
37+
schema, sourcemeta::core::schema_official_walker,
38+
sourcemeta::core::official_resolver);
3939

40-
const auto expected = sourcemeta::core::parse(R"JSON({
40+
const auto expected = sourcemeta::core::parse_json(R"JSON({
4141
"$schema": "https://json-schema.org/draft/2020-12/schema",
4242
"type": "object",
4343
"minProperties": 0,
@@ -48,7 +48,7 @@ TEST(JSONBinPack_Canonicalizer_Any_2020_12, then_else_without_if_1) {
4848
}
4949

5050
TEST(JSONBinPack_Canonicalizer_Any_2020_12, duplicate_allof_branches_1) {
51-
auto schema = sourcemeta::core::parse(R"JSON({
51+
auto schema = sourcemeta::core::parse_json(R"JSON({
5252
"$schema": "https://json-schema.org/draft/2020-12/schema",
5353
"allOf": [
5454
{ "type": "number" },
@@ -57,11 +57,11 @@ TEST(JSONBinPack_Canonicalizer_Any_2020_12, duplicate_allof_branches_1) {
5757
]
5858
})JSON");
5959

60-
sourcemeta::jsonbinpack::canonicalize(schema,
61-
sourcemeta::core::default_schema_walker,
62-
sourcemeta::core::official_resolver);
60+
sourcemeta::jsonbinpack::canonicalize(
61+
schema, sourcemeta::core::schema_official_walker,
62+
sourcemeta::core::official_resolver);
6363

64-
const auto expected = sourcemeta::core::parse(R"JSON({
64+
const auto expected = sourcemeta::core::parse_json(R"JSON({
6565
"$schema": "https://json-schema.org/draft/2020-12/schema",
6666
"allOf": [
6767
{ "type": "number", "multipleOf": 1 },
@@ -73,7 +73,7 @@ TEST(JSONBinPack_Canonicalizer_Any_2020_12, duplicate_allof_branches_1) {
7373
}
7474

7575
TEST(JSONBinPack_Canonicalizer_Any_2020_12, duplicate_allof_branches_2) {
76-
auto schema = sourcemeta::core::parse(R"JSON({
76+
auto schema = sourcemeta::core::parse_json(R"JSON({
7777
"$schema": "https://json-schema.org/draft/2020-12/schema",
7878
"allOf": [
7979
{ "type": "number" },
@@ -82,11 +82,11 @@ TEST(JSONBinPack_Canonicalizer_Any_2020_12, duplicate_allof_branches_2) {
8282
]
8383
})JSON");
8484

85-
sourcemeta::jsonbinpack::canonicalize(schema,
86-
sourcemeta::core::default_schema_walker,
87-
sourcemeta::core::official_resolver);
85+
sourcemeta::jsonbinpack::canonicalize(
86+
schema, sourcemeta::core::schema_official_walker,
87+
sourcemeta::core::official_resolver);
8888

89-
const auto expected = sourcemeta::core::parse(R"JSON({
89+
const auto expected = sourcemeta::core::parse_json(R"JSON({
9090
"$schema": "https://json-schema.org/draft/2020-12/schema",
9191
"allOf": [
9292
{ "type": "number", "multipleOf": 1 },
@@ -98,7 +98,7 @@ TEST(JSONBinPack_Canonicalizer_Any_2020_12, duplicate_allof_branches_2) {
9898
}
9999

100100
TEST(JSONBinPack_Canonicalizer_Any_2020_12, duplicate_allof_branches_3) {
101-
auto schema = sourcemeta::core::parse(R"JSON({
101+
auto schema = sourcemeta::core::parse_json(R"JSON({
102102
"$schema": "https://json-schema.org/draft/2020-12/schema",
103103
"allOf": [
104104
{ "type": "number" },
@@ -114,11 +114,11 @@ TEST(JSONBinPack_Canonicalizer_Any_2020_12, duplicate_allof_branches_3) {
114114
]
115115
})JSON");
116116

117-
sourcemeta::jsonbinpack::canonicalize(schema,
118-
sourcemeta::core::default_schema_walker,
119-
sourcemeta::core::official_resolver);
117+
sourcemeta::jsonbinpack::canonicalize(
118+
schema, sourcemeta::core::schema_official_walker,
119+
sourcemeta::core::official_resolver);
120120

121-
const auto expected = sourcemeta::core::parse(R"JSON({
121+
const auto expected = sourcemeta::core::parse_json(R"JSON({
122122
"$schema": "https://json-schema.org/draft/2020-12/schema",
123123
"allOf": [
124124
{ "type": "number", "multipleOf": 1 },
@@ -130,7 +130,7 @@ TEST(JSONBinPack_Canonicalizer_Any_2020_12, duplicate_allof_branches_3) {
130130
}
131131

132132
TEST(JSONBinPack_Canonicalizer_Any_2020_12, duplicate_anyof_branches_1) {
133-
auto schema = sourcemeta::core::parse(R"JSON({
133+
auto schema = sourcemeta::core::parse_json(R"JSON({
134134
"$schema": "https://json-schema.org/draft/2020-12/schema",
135135
"anyOf": [
136136
{ "type": "number" },
@@ -139,11 +139,11 @@ TEST(JSONBinPack_Canonicalizer_Any_2020_12, duplicate_anyof_branches_1) {
139139
]
140140
})JSON");
141141

142-
sourcemeta::jsonbinpack::canonicalize(schema,
143-
sourcemeta::core::default_schema_walker,
144-
sourcemeta::core::official_resolver);
142+
sourcemeta::jsonbinpack::canonicalize(
143+
schema, sourcemeta::core::schema_official_walker,
144+
sourcemeta::core::official_resolver);
145145

146-
const auto expected = sourcemeta::core::parse(R"JSON({
146+
const auto expected = sourcemeta::core::parse_json(R"JSON({
147147
"$schema": "https://json-schema.org/draft/2020-12/schema",
148148
"anyOf": [
149149
{ "type": "number", "multipleOf": 1 },
@@ -155,7 +155,7 @@ TEST(JSONBinPack_Canonicalizer_Any_2020_12, duplicate_anyof_branches_1) {
155155
}
156156

157157
TEST(JSONBinPack_Canonicalizer_Any_2020_12, duplicate_anyof_branches_2) {
158-
auto schema = sourcemeta::core::parse(R"JSON({
158+
auto schema = sourcemeta::core::parse_json(R"JSON({
159159
"$schema": "https://json-schema.org/draft/2020-12/schema",
160160
"anyOf": [
161161
{ "type": "number" },
@@ -164,11 +164,11 @@ TEST(JSONBinPack_Canonicalizer_Any_2020_12, duplicate_anyof_branches_2) {
164164
]
165165
})JSON");
166166

167-
sourcemeta::jsonbinpack::canonicalize(schema,
168-
sourcemeta::core::default_schema_walker,
169-
sourcemeta::core::official_resolver);
167+
sourcemeta::jsonbinpack::canonicalize(
168+
schema, sourcemeta::core::schema_official_walker,
169+
sourcemeta::core::official_resolver);
170170

171-
const auto expected = sourcemeta::core::parse(R"JSON({
171+
const auto expected = sourcemeta::core::parse_json(R"JSON({
172172
"$schema": "https://json-schema.org/draft/2020-12/schema",
173173
"anyOf": [
174174
{ "type": "number", "multipleOf": 1 },
@@ -180,7 +180,7 @@ TEST(JSONBinPack_Canonicalizer_Any_2020_12, duplicate_anyof_branches_2) {
180180
}
181181

182182
TEST(JSONBinPack_Canonicalizer_Any_2020_12, duplicate_anyof_branches_3) {
183-
auto schema = sourcemeta::core::parse(R"JSON({
183+
auto schema = sourcemeta::core::parse_json(R"JSON({
184184
"$schema": "https://json-schema.org/draft/2020-12/schema",
185185
"anyOf": [
186186
{ "type": "number" },
@@ -196,11 +196,11 @@ TEST(JSONBinPack_Canonicalizer_Any_2020_12, duplicate_anyof_branches_3) {
196196
]
197197
})JSON");
198198

199-
sourcemeta::jsonbinpack::canonicalize(schema,
200-
sourcemeta::core::default_schema_walker,
201-
sourcemeta::core::official_resolver);
199+
sourcemeta::jsonbinpack::canonicalize(
200+
schema, sourcemeta::core::schema_official_walker,
201+
sourcemeta::core::official_resolver);
202202

203-
const auto expected = sourcemeta::core::parse(R"JSON({
203+
const auto expected = sourcemeta::core::parse_json(R"JSON({
204204
"$schema": "https://json-schema.org/draft/2020-12/schema",
205205
"anyOf": [
206206
{ "type": "number", "multipleOf": 1 },
@@ -212,16 +212,16 @@ TEST(JSONBinPack_Canonicalizer_Any_2020_12, duplicate_anyof_branches_3) {
212212
}
213213

214214
TEST(JSONBinPack_Canonicalizer_Any_2020_12, type_union_anyof_1) {
215-
auto schema = sourcemeta::core::parse(R"JSON({
215+
auto schema = sourcemeta::core::parse_json(R"JSON({
216216
"$schema": "https://json-schema.org/draft/2020-12/schema",
217217
"type": [ "object", "array" ]
218218
})JSON");
219219

220-
sourcemeta::jsonbinpack::canonicalize(schema,
221-
sourcemeta::core::default_schema_walker,
222-
sourcemeta::core::official_resolver);
220+
sourcemeta::jsonbinpack::canonicalize(
221+
schema, sourcemeta::core::schema_official_walker,
222+
sourcemeta::core::official_resolver);
223223

224-
const auto expected = sourcemeta::core::parse(R"JSON({
224+
const auto expected = sourcemeta::core::parse_json(R"JSON({
225225
"$schema": "https://json-schema.org/draft/2020-12/schema",
226226
"anyOf": [
227227
{
@@ -240,17 +240,17 @@ TEST(JSONBinPack_Canonicalizer_Any_2020_12, type_union_anyof_1) {
240240
}
241241

242242
TEST(JSONBinPack_Canonicalizer_Any_2020_12, type_union_anyof_2) {
243-
auto schema = sourcemeta::core::parse(R"JSON({
243+
auto schema = sourcemeta::core::parse_json(R"JSON({
244244
"$schema": "https://json-schema.org/draft/2020-12/schema",
245245
"type": [ "object", "array" ],
246246
"maxProperties": 3
247247
})JSON");
248248

249-
sourcemeta::jsonbinpack::canonicalize(schema,
250-
sourcemeta::core::default_schema_walker,
251-
sourcemeta::core::official_resolver);
249+
sourcemeta::jsonbinpack::canonicalize(
250+
schema, sourcemeta::core::schema_official_walker,
251+
sourcemeta::core::official_resolver);
252252

253-
const auto expected = sourcemeta::core::parse(R"JSON({
253+
const auto expected = sourcemeta::core::parse_json(R"JSON({
254254
"$schema": "https://json-schema.org/draft/2020-12/schema",
255255
"anyOf": [
256256
{
@@ -270,7 +270,7 @@ TEST(JSONBinPack_Canonicalizer_Any_2020_12, type_union_anyof_2) {
270270
}
271271

272272
TEST(JSONBinPack_Canonicalizer_Any_2020_12, type_union_anyof_3) {
273-
auto schema = sourcemeta::core::parse(R"JSON({
273+
auto schema = sourcemeta::core::parse_json(R"JSON({
274274
"$schema": "https://json-schema.org/draft/2020-12/schema",
275275
"type": "object",
276276
"properties": {
@@ -280,11 +280,11 @@ TEST(JSONBinPack_Canonicalizer_Any_2020_12, type_union_anyof_3) {
280280
}
281281
})JSON");
282282

283-
sourcemeta::jsonbinpack::canonicalize(schema,
284-
sourcemeta::core::default_schema_walker,
285-
sourcemeta::core::official_resolver);
283+
sourcemeta::jsonbinpack::canonicalize(
284+
schema, sourcemeta::core::schema_official_walker,
285+
sourcemeta::core::official_resolver);
286286

287-
const auto expected = sourcemeta::core::parse(R"JSON({
287+
const auto expected = sourcemeta::core::parse_json(R"JSON({
288288
"$schema": "https://json-schema.org/draft/2020-12/schema",
289289
"type": "object",
290290
"minProperties": 0,
@@ -309,15 +309,15 @@ TEST(JSONBinPack_Canonicalizer_Any_2020_12, type_union_anyof_3) {
309309
}
310310

311311
TEST(JSONBinPack_Canonicalizer_Any_2020_12, implicit_type_union_1) {
312-
auto schema = sourcemeta::core::parse(R"JSON({
312+
auto schema = sourcemeta::core::parse_json(R"JSON({
313313
"$schema": "https://json-schema.org/draft/2020-12/schema"
314314
})JSON");
315315

316-
sourcemeta::jsonbinpack::canonicalize(schema,
317-
sourcemeta::core::default_schema_walker,
318-
sourcemeta::core::official_resolver);
316+
sourcemeta::jsonbinpack::canonicalize(
317+
schema, sourcemeta::core::schema_official_walker,
318+
sourcemeta::core::official_resolver);
319319

320-
const auto expected = sourcemeta::core::parse(R"JSON({
320+
const auto expected = sourcemeta::core::parse_json(R"JSON({
321321
"$schema": "https://json-schema.org/draft/2020-12/schema",
322322
"anyOf": [
323323
{ "enum": [ null ] },
@@ -353,11 +353,11 @@ TEST(JSONBinPack_Canonicalizer_Any_2020_12, boolean_schema_1) {
353353
sourcemeta::core::JSON schema{true};
354354

355355
sourcemeta::jsonbinpack::canonicalize(
356-
schema, sourcemeta::core::default_schema_walker,
356+
schema, sourcemeta::core::schema_official_walker,
357357
sourcemeta::core::official_resolver,
358358
"https://json-schema.org/draft/2020-12/schema");
359359

360-
const auto expected = sourcemeta::core::parse(R"JSON({
360+
const auto expected = sourcemeta::core::parse_json(R"JSON({
361361
"anyOf": [
362362
{ "enum": [ null ] },
363363
{ "enum": [ false, true ] },
@@ -392,7 +392,7 @@ TEST(JSONBinPack_Canonicalizer_Any_2020_12, boolean_schema_2) {
392392
sourcemeta::core::JSON schema{false};
393393

394394
sourcemeta::jsonbinpack::canonicalize(
395-
schema, sourcemeta::core::default_schema_walker,
395+
schema, sourcemeta::core::schema_official_walker,
396396
sourcemeta::core::official_resolver,
397397
"https://json-schema.org/draft/2020-12/schema");
398398

0 commit comments

Comments
 (0)