Skip to content

Commit 2f865f3

Browse files
authored
Upgrade Core to 90d0082e6c61ed5f6f3106db4105c7822cc41838 (#897)
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
1 parent 071c0c0 commit 2f865f3

94 files changed

Lines changed: 22460 additions & 573 deletions

File tree

Some content is hidden

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

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 1dcbac42809cf87cb5b045106b863e17ad84ba02
2-
core https://github.com/sourcemeta/core 0836d83873a0328b5a1a25848f29bdb8253734c0
2+
core https://github.com/sourcemeta/core 90d0082e6c61ed5f6f3106db4105c7822cc41838
33
bootstrap https://github.com/twbs/bootstrap 1a6fdfae6be09b09eaced8f0e442ca6f7680a61e

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ namespace sourcemeta::jsonbinpack {
4040
/// })JSON")};
4141
///
4242
/// sourcemeta::jsonbinpack::compile(
43-
/// schema, sourcemeta::core::schema_official_walker,
44-
/// sourcemeta::core::schema_official_resolver);
43+
/// schema, sourcemeta::core::schema_walker,
44+
/// sourcemeta::core::schema_resolver);
4545
///
4646
/// sourcemeta::core::prettify(schema, std::cout);
4747
/// std::cout << std::endl;
@@ -73,8 +73,8 @@ auto compile(sourcemeta::core::JSON &schema,
7373
/// })JSON")};
7474
///
7575
/// sourcemeta::jsonbinpack::canonicalize(
76-
/// schema, sourcemeta::core::schema_official_walker,
77-
/// sourcemeta::core::schema_official_resolver);
76+
/// schema, sourcemeta::core::schema_walker,
77+
/// sourcemeta::core::schema_resolver);
7878
///
7979
/// sourcemeta::core::prettify(schema, std::cout);
8080
/// std::cout << std::endl;

src/runtime/include/sourcemeta/jsonbinpack/runtime.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class SOURCEMETA_JSONBINPACK_RUNTIME_EXPORT EncodingError
4949
}
5050

5151
private:
52-
const sourcemeta::core::JSON::String message_;
52+
sourcemeta::core::JSON::String message_;
5353
};
5454

5555
#if defined(_MSC_VER)

src/runtime/include/sourcemeta/jsonbinpack/runtime_encoder_cache.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,11 @@ namespace sourcemeta::jsonbinpack {
1717

1818
class SOURCEMETA_JSONBINPACK_RUNTIME_EXPORT Cache {
1919
public:
20-
enum class Type { Standalone, PrefixLengthVarintPlusOne };
20+
enum class Type : std::uint8_t { Standalone, PrefixLengthVarintPlusOne };
2121
auto record(const sourcemeta::core::JSON::String &value,
2222
const std::uint64_t offset, const Type type) -> void;
23-
auto find(const sourcemeta::core::JSON::String &value, const Type type) const
23+
[[nodiscard]] auto find(const sourcemeta::core::JSON::String &value,
24+
const Type type) const
2425
-> std::optional<std::uint64_t>;
2526

2627
#ifndef DOXYGEN

src/runtime/include/sourcemeta/jsonbinpack/runtime_encoding.h

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,11 @@ using Encoding = std::variant<
9292
// clang-format on
9393
struct BOUNDED_MULTIPLE_8BITS_ENUM_FIXED {
9494
/// The inclusive minimum value
95-
const std::int64_t minimum;
95+
std::int64_t minimum;
9696
/// The inclusive maximum value
97-
const std::int64_t maximum;
97+
std::int64_t maximum;
9898
/// The multiplier value
99-
const std::uint64_t multiplier;
99+
std::uint64_t multiplier;
100100
};
101101

102102
// clang-format off
@@ -133,9 +133,9 @@ struct BOUNDED_MULTIPLE_8BITS_ENUM_FIXED {
133133
// clang-format on
134134
struct FLOOR_MULTIPLE_ENUM_VARINT {
135135
/// The inclusive minimum value
136-
const std::int64_t minimum;
136+
std::int64_t minimum;
137137
/// The multiplier value
138-
const std::uint64_t multiplier;
138+
std::uint64_t multiplier;
139139
};
140140

141141
// clang-format off
@@ -171,9 +171,9 @@ struct FLOOR_MULTIPLE_ENUM_VARINT {
171171
// clang-format on
172172
struct ROOF_MULTIPLE_MIRROR_ENUM_VARINT {
173173
/// The inclusive maximum value
174-
const std::int64_t maximum;
174+
std::int64_t maximum;
175175
/// The multiplier value
176-
const std::uint64_t multiplier;
176+
std::uint64_t multiplier;
177177
};
178178

179179
// clang-format off
@@ -206,7 +206,7 @@ struct ROOF_MULTIPLE_MIRROR_ENUM_VARINT {
206206
// clang-format on
207207
struct ARBITRARY_MULTIPLE_ZIGZAG_VARINT {
208208
/// The multiplier value
209-
const std::uint64_t multiplier;
209+
std::uint64_t multiplier;
210210
};
211211

212212
/// @}
@@ -302,7 +302,7 @@ struct DOUBLE_VARINT_TUPLE {};
302302
// clang-format on
303303
struct BYTE_CHOICE_INDEX {
304304
/// The set of choice values
305-
const std::vector<sourcemeta::core::JSON> choices;
305+
std::vector<sourcemeta::core::JSON> choices;
306306
};
307307

308308
// clang-format off
@@ -336,7 +336,7 @@ struct BYTE_CHOICE_INDEX {
336336
// clang-format on
337337
struct LARGE_CHOICE_INDEX {
338338
/// The set of choice values
339-
const std::vector<sourcemeta::core::JSON> choices;
339+
std::vector<sourcemeta::core::JSON> choices;
340340
};
341341

342342
// clang-format off
@@ -375,7 +375,7 @@ struct LARGE_CHOICE_INDEX {
375375
// clang-format on
376376
struct TOP_LEVEL_BYTE_CHOICE_INDEX {
377377
/// The set of choice values
378-
const std::vector<sourcemeta::core::JSON> choices;
378+
std::vector<sourcemeta::core::JSON> choices;
379379
};
380380

381381
// clang-format off
@@ -397,7 +397,7 @@ struct TOP_LEVEL_BYTE_CHOICE_INDEX {
397397
// clang-format on
398398
struct CONST_NONE {
399399
/// The constant value
400-
const sourcemeta::core::JSON value;
400+
sourcemeta::core::JSON value;
401401
};
402402

403403
// TODO: Write brief description
@@ -490,7 +490,7 @@ static_assert(SUBTYPE_LONG_STRING_BASE_EXPONENT_10 == 10);
490490
// clang-format on
491491
struct UTF8_STRING_NO_LENGTH {
492492
/// The string UTF-8 byte-length
493-
const std::uint64_t size;
493+
std::uint64_t size;
494494
};
495495

496496
// clang-format off
@@ -544,7 +544,7 @@ struct UTF8_STRING_NO_LENGTH {
544544
// clang-format on
545545
struct FLOOR_VARINT_PREFIX_UTF8_STRING_SHARED {
546546
/// The inclusive minimum string UTF-8 byte-length
547-
const std::uint64_t minimum;
547+
std::uint64_t minimum;
548548
};
549549

550550
// clang-format off
@@ -598,7 +598,7 @@ struct FLOOR_VARINT_PREFIX_UTF8_STRING_SHARED {
598598
// clang-format on
599599
struct ROOF_VARINT_PREFIX_UTF8_STRING_SHARED {
600600
/// The inclusive maximum string UTF-8 byte-length
601-
const std::uint64_t maximum;
601+
std::uint64_t maximum;
602602
};
603603

604604
// clang-format off
@@ -658,9 +658,9 @@ struct ROOF_VARINT_PREFIX_UTF8_STRING_SHARED {
658658
// clang-format on
659659
struct BOUNDED_8BIT_PREFIX_UTF8_STRING_SHARED {
660660
/// The inclusive minimum string UTF-8 byte-length
661-
const std::uint64_t minimum;
661+
std::uint64_t minimum;
662662
/// The inclusive maximum string UTF-8 byte-length
663-
const std::uint64_t maximum;
663+
std::uint64_t maximum;
664664
};
665665

666666
// clang-format off
@@ -789,11 +789,11 @@ struct PREFIX_VARINT_LENGTH_STRING_SHARED {};
789789
// clang-format on
790790
struct FIXED_TYPED_ARRAY {
791791
/// The array length
792-
const std::uint64_t size;
792+
std::uint64_t size;
793793
/// Element encoding
794-
const std::shared_ptr<Encoding> encoding;
794+
std::shared_ptr<Encoding> encoding;
795795
/// Positional encodings
796-
const std::vector<Encoding> prefix_encodings;
796+
std::vector<Encoding> prefix_encodings;
797797
};
798798

799799
// clang-format off
@@ -838,13 +838,13 @@ struct FIXED_TYPED_ARRAY {
838838
// clang-format on
839839
struct BOUNDED_8BITS_TYPED_ARRAY {
840840
/// The minimum length of the array
841-
const std::uint64_t minimum;
841+
std::uint64_t minimum;
842842
/// The maximum length of the array
843-
const std::uint64_t maximum;
843+
std::uint64_t maximum;
844844
/// Element encoding
845-
const std::shared_ptr<Encoding> encoding;
845+
std::shared_ptr<Encoding> encoding;
846846
/// Positional encodings
847-
const std::vector<Encoding> prefix_encodings;
847+
std::vector<Encoding> prefix_encodings;
848848
};
849849

850850
// clang-format off
@@ -886,11 +886,11 @@ struct BOUNDED_8BITS_TYPED_ARRAY {
886886
// clang-format on
887887
struct FLOOR_TYPED_ARRAY {
888888
/// The minimum length of the array
889-
const std::uint64_t minimum;
889+
std::uint64_t minimum;
890890
/// Element encoding
891-
const std::shared_ptr<Encoding> encoding;
891+
std::shared_ptr<Encoding> encoding;
892892
/// Positional encodings
893-
const std::vector<Encoding> prefix_encodings;
893+
std::vector<Encoding> prefix_encodings;
894894
};
895895

896896
// clang-format off
@@ -931,11 +931,11 @@ struct FLOOR_TYPED_ARRAY {
931931
// clang-format on
932932
struct ROOF_TYPED_ARRAY {
933933
/// The maximum length of the array
934-
const std::uint64_t maximum;
934+
std::uint64_t maximum;
935935
/// Element encoding
936-
const std::shared_ptr<Encoding> encoding;
936+
std::shared_ptr<Encoding> encoding;
937937
/// Positional encodings
938-
const std::vector<Encoding> prefix_encodings;
938+
std::vector<Encoding> prefix_encodings;
939939
};
940940

941941
/// @}
@@ -988,11 +988,11 @@ struct ROOF_TYPED_ARRAY {
988988
// clang-format on
989989
struct FIXED_TYPED_ARBITRARY_OBJECT {
990990
/// The object size
991-
const std::uint64_t size;
991+
std::uint64_t size;
992992
/// Key encoding
993-
const std::shared_ptr<Encoding> key_encoding;
993+
std::shared_ptr<Encoding> key_encoding;
994994
/// Value encoding
995-
const std::shared_ptr<Encoding> encoding;
995+
std::shared_ptr<Encoding> encoding;
996996
};
997997

998998
// clang-format off
@@ -1034,9 +1034,9 @@ struct FIXED_TYPED_ARBITRARY_OBJECT {
10341034
// clang-format on
10351035
struct VARINT_TYPED_ARBITRARY_OBJECT {
10361036
/// Key encoding
1037-
const std::shared_ptr<Encoding> key_encoding;
1037+
std::shared_ptr<Encoding> key_encoding;
10381038
/// Value encoding
1039-
const std::shared_ptr<Encoding> encoding;
1039+
std::shared_ptr<Encoding> encoding;
10401040
};
10411041

10421042
/// @}

src/runtime/include/sourcemeta/jsonbinpack/runtime_input_stream.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class SOURCEMETA_JSONBINPACK_RUNTIME_EXPORT InputStream {
2222
InputStream(const InputStream &) = delete;
2323
auto operator=(const InputStream &) -> InputStream & = delete;
2424

25-
auto position() const noexcept -> std::uint64_t;
25+
[[nodiscard]] auto position() const noexcept -> std::uint64_t;
2626
auto seek(const std::uint64_t offset) -> void;
2727
// Seek backwards given a relative offset
2828
auto rewind(const std::uint64_t relative_offset, const std::uint64_t position)
@@ -33,7 +33,7 @@ class SOURCEMETA_JSONBINPACK_RUNTIME_EXPORT InputStream {
3333
auto get_word() -> std::uint16_t;
3434
auto get_varint() -> std::uint64_t;
3535
auto get_varint_zigzag() -> std::int64_t;
36-
auto has_more_data() const noexcept -> bool;
36+
[[nodiscard]] auto has_more_data() const noexcept -> bool;
3737
auto get_string_utf8(const std::uint64_t length)
3838
-> sourcemeta::core::JSON::String;
3939

src/runtime/include/sourcemeta/jsonbinpack/runtime_output_stream.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class SOURCEMETA_JSONBINPACK_RUNTIME_EXPORT OutputStream {
2323
OutputStream(const OutputStream &) = delete;
2424
auto operator=(const OutputStream &) -> OutputStream & = delete;
2525

26-
auto position() const noexcept -> std::uint64_t;
26+
[[nodiscard]] auto position() const noexcept -> std::uint64_t;
2727
auto put_byte(const std::uint8_t byte) -> void;
2828
auto put_bytes(const std::uint16_t bytes) -> void;
2929
auto put_varint(const std::uint64_t value) -> void;

src/runtime/loader_v1_any.h

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ auto BYTE_CHOICE_INDEX(const sourcemeta::core::JSON &options) -> Encoding {
1717
assert(choices.is_array());
1818
const auto &array{choices.as_array()};
1919
std::vector<sourcemeta::core::JSON> elements{array.cbegin(), array.cend()};
20-
return sourcemeta::jsonbinpack::BYTE_CHOICE_INDEX({std::move(elements)});
20+
return sourcemeta::jsonbinpack::BYTE_CHOICE_INDEX{.choices =
21+
std::move(elements)};
2122
}
2223

2324
auto LARGE_CHOICE_INDEX(const sourcemeta::core::JSON &options) -> Encoding {
@@ -26,7 +27,8 @@ auto LARGE_CHOICE_INDEX(const sourcemeta::core::JSON &options) -> Encoding {
2627
assert(choices.is_array());
2728
const auto &array{choices.as_array()};
2829
std::vector<sourcemeta::core::JSON> elements{array.cbegin(), array.cend()};
29-
return sourcemeta::jsonbinpack::LARGE_CHOICE_INDEX({std::move(elements)});
30+
return sourcemeta::jsonbinpack::LARGE_CHOICE_INDEX{.choices =
31+
std::move(elements)};
3032
}
3133

3234
auto TOP_LEVEL_BYTE_CHOICE_INDEX(const sourcemeta::core::JSON &options)
@@ -36,13 +38,13 @@ auto TOP_LEVEL_BYTE_CHOICE_INDEX(const sourcemeta::core::JSON &options)
3638
assert(choices.is_array());
3739
const auto &array{choices.as_array()};
3840
std::vector<sourcemeta::core::JSON> elements{array.cbegin(), array.cend()};
39-
return sourcemeta::jsonbinpack::TOP_LEVEL_BYTE_CHOICE_INDEX(
40-
{std::move(elements)});
41+
return sourcemeta::jsonbinpack::TOP_LEVEL_BYTE_CHOICE_INDEX{
42+
.choices = std::move(elements)};
4143
}
4244

4345
auto CONST_NONE(const sourcemeta::core::JSON &options) -> Encoding {
4446
assert(options.defines("value"));
45-
return sourcemeta::jsonbinpack::CONST_NONE({options.at("value")});
47+
return sourcemeta::jsonbinpack::CONST_NONE{.value = options.at("value")};
4648
}
4749

4850
auto ANY_PACKED_TYPE_TAG_BYTE_PREFIX(const sourcemeta::core::JSON &)

src/runtime/loader_v1_array.h

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,9 @@ auto FIXED_TYPED_ARRAY(const sourcemeta::core::JSON &options) -> Encoding {
3232
[](const auto &element) { return load(element); });
3333
assert(encodings.size() == prefix_encodings.size());
3434
return sourcemeta::jsonbinpack::FIXED_TYPED_ARRAY{
35-
static_cast<std::uint64_t>(size.to_integer()),
36-
std::make_shared<Encoding>(load(array_encoding)), std::move(encodings)};
35+
.size = static_cast<std::uint64_t>(size.to_integer()),
36+
.encoding = std::make_shared<Encoding>(load(array_encoding)),
37+
.prefix_encodings = std::move(encodings)};
3738
}
3839

3940
auto BOUNDED_8BITS_TYPED_ARRAY(const sourcemeta::core::JSON &options)
@@ -59,9 +60,10 @@ auto BOUNDED_8BITS_TYPED_ARRAY(const sourcemeta::core::JSON &options)
5960
[](const auto &element) { return load(element); });
6061
assert(encodings.size() == prefix_encodings.size());
6162
return sourcemeta::jsonbinpack::BOUNDED_8BITS_TYPED_ARRAY{
62-
static_cast<std::uint64_t>(minimum.to_integer()),
63-
static_cast<std::uint64_t>(maximum.to_integer()),
64-
std::make_shared<Encoding>(load(array_encoding)), std::move(encodings)};
63+
.minimum = static_cast<std::uint64_t>(minimum.to_integer()),
64+
.maximum = static_cast<std::uint64_t>(maximum.to_integer()),
65+
.encoding = std::make_shared<Encoding>(load(array_encoding)),
66+
.prefix_encodings = std::move(encodings)};
6567
}
6668

6769
auto FLOOR_TYPED_ARRAY(const sourcemeta::core::JSON &options) -> Encoding {
@@ -82,8 +84,9 @@ auto FLOOR_TYPED_ARRAY(const sourcemeta::core::JSON &options) -> Encoding {
8284
[](const auto &element) { return load(element); });
8385
assert(encodings.size() == prefix_encodings.size());
8486
return sourcemeta::jsonbinpack::FLOOR_TYPED_ARRAY{
85-
static_cast<std::uint64_t>(minimum.to_integer()),
86-
std::make_shared<Encoding>(load(array_encoding)), std::move(encodings)};
87+
.minimum = static_cast<std::uint64_t>(minimum.to_integer()),
88+
.encoding = std::make_shared<Encoding>(load(array_encoding)),
89+
.prefix_encodings = std::move(encodings)};
8790
}
8891

8992
auto ROOF_TYPED_ARRAY(const sourcemeta::core::JSON &options) -> Encoding {
@@ -104,8 +107,9 @@ auto ROOF_TYPED_ARRAY(const sourcemeta::core::JSON &options) -> Encoding {
104107
[](const auto &element) { return load(element); });
105108
assert(encodings.size() == prefix_encodings.size());
106109
return sourcemeta::jsonbinpack::ROOF_TYPED_ARRAY{
107-
static_cast<std::uint64_t>(maximum.to_integer()),
108-
std::make_shared<Encoding>(load(array_encoding)), std::move(encodings)};
110+
.maximum = static_cast<std::uint64_t>(maximum.to_integer()),
111+
.encoding = std::make_shared<Encoding>(load(array_encoding)),
112+
.prefix_encodings = std::move(encodings)};
109113
}
110114

111115
} // namespace sourcemeta::jsonbinpack::v1

0 commit comments

Comments
 (0)