diff --git a/Package.resolved b/Package.resolved
index 41c3bf8e..e4afe4d0 100644
--- a/Package.resolved
+++ b/Package.resolved
@@ -60,8 +60,8 @@
"repositoryURL": "https://github.com/jpsim/Yams.git",
"state": {
"branch": null,
- "revision": "c947a306d2e80ecb2c0859047b35c73b8e1ca27f",
- "version": "2.0.0"
+ "revision": "81a65c4069c28011ee432f2858ba0de49b086677",
+ "version": "3.0.1"
}
}
]
diff --git a/Package.swift b/Package.swift
index 95ed3eff..fd0136dd 100644
--- a/Package.swift
+++ b/Package.swift
@@ -11,7 +11,7 @@ let package = Package(
.package(url: "https://github.com/kylef/Commander.git", from: "0.9.0"),
.package(url: "https://github.com/kylef/PathKit.git", from: "0.9.0"),
.package(url: "https://github.com/kylef/Stencil.git", from: "0.13.0"),
- .package(url: "https://github.com/jpsim/Yams.git", from: "2.0.0"),
+ .package(url: "https://github.com/jpsim/Yams.git", from: "3.0.0"),
.package(url: "https://github.com/SwiftGen/StencilSwiftKit.git", from: "2.7.0"),
.package(url: "https://github.com/tid-kijyun/Kanna.git", from: "5.2.2")
],
diff --git a/Podfile.lock b/Podfile.lock
index b003f37c..9263c015 100644
--- a/Podfile.lock
+++ b/Podfile.lock
@@ -7,7 +7,7 @@ PODS:
- StencilSwiftKit (2.7.2):
- Stencil (~> 0.13.1)
- SwiftLint (0.39.2)
- - Yams (2.0.0)
+ - Yams (3.0.1)
DEPENDENCIES:
- Commander (~> 0.9)
@@ -15,7 +15,7 @@ DEPENDENCIES:
- PathKit (~> 0.9)
- StencilSwiftKit (~> 2.7)
- SwiftLint (~> 0.39)
- - Yams (~> 2.0)
+ - Yams (~> 3.0)
SPEC REPOS:
trunk:
@@ -34,7 +34,7 @@ SPEC CHECKSUMS:
Stencil: b5128a0a43ece9225db5cbd94d6569fe6fba609b
StencilSwiftKit: 9ebd42556b6c7396440f286b6c9aca1549c963ff
SwiftLint: 22ccbbe3b8008684be5955693bab135e0ed6a447
- Yams: cb96472112d99e4b368f8dae9ab62e8a3eb8a3f9
+ Yams: 4199a97883e0369046e3fe882fcc95e559966370
PODFILE CHECKSUM: b2f00ffca5a82ce8de396f67cf5bb161f152e7e0
diff --git a/Pods/.project_cache/installation_cache.yaml b/Pods/.project_cache/installation_cache.yaml
index c21afdf9..d5a5ad77 100644
--- a/Pods/.project_cache/installation_cache.yaml
+++ b/Pods/.project_cache/installation_cache.yaml
@@ -81,10 +81,10 @@ CACHE_KEYS:
Yams:
:debug: bd049f3173d31876da7ed672e2e00ece
:release: bd049f3173d31876da7ed672e2e00ece
- CHECKSUM: cb96472112d99e4b368f8dae9ab62e8a3eb8a3f9
+ CHECKSUM: 4199a97883e0369046e3fe882fcc95e559966370
PROJECT_NAME: Yams
SPECS:
- - Yams (2.0.0)
+ - Yams (3.0.1)
OBJECT_VERSION: 47
PLUGINS:
cocoapods-stats:
diff --git a/Pods/Manifest.lock b/Pods/Manifest.lock
index b003f37c..9263c015 100644
--- a/Pods/Manifest.lock
+++ b/Pods/Manifest.lock
@@ -7,7 +7,7 @@ PODS:
- StencilSwiftKit (2.7.2):
- Stencil (~> 0.13.1)
- SwiftLint (0.39.2)
- - Yams (2.0.0)
+ - Yams (3.0.1)
DEPENDENCIES:
- Commander (~> 0.9)
@@ -15,7 +15,7 @@ DEPENDENCIES:
- PathKit (~> 0.9)
- StencilSwiftKit (~> 2.7)
- SwiftLint (~> 0.39)
- - Yams (~> 2.0)
+ - Yams (~> 3.0)
SPEC REPOS:
trunk:
@@ -34,7 +34,7 @@ SPEC CHECKSUMS:
Stencil: b5128a0a43ece9225db5cbd94d6569fe6fba609b
StencilSwiftKit: 9ebd42556b6c7396440f286b6c9aca1549c963ff
SwiftLint: 22ccbbe3b8008684be5955693bab135e0ed6a447
- Yams: cb96472112d99e4b368f8dae9ab62e8a3eb8a3f9
+ Yams: 4199a97883e0369046e3fe882fcc95e559966370
PODFILE CHECKSUM: b2f00ffca5a82ce8de396f67cf5bb161f152e7e0
diff --git a/Pods/Target Support Files/Yams/Yams-Info.plist b/Pods/Target Support Files/Yams/Yams-Info.plist
index 0a12077e..b0b461e3 100644
--- a/Pods/Target Support Files/Yams/Yams-Info.plist
+++ b/Pods/Target Support Files/Yams/Yams-Info.plist
@@ -15,7 +15,7 @@
CFBundlePackageType
FMWK
CFBundleShortVersionString
- 2.0.0
+ 3.0.1
CFBundleSignature
????
CFBundleVersion
diff --git a/Pods/Yams.xcodeproj/project.pbxproj b/Pods/Yams.xcodeproj/project.pbxproj
index d599e18f..2f12aa6f 100644
--- a/Pods/Yams.xcodeproj/project.pbxproj
+++ b/Pods/Yams.xcodeproj/project.pbxproj
@@ -278,6 +278,39 @@
/* End PBXSourcesBuildPhase section */
/* Begin XCBuildConfiguration section */
+ 021BAC56583E0E45F775510BC5B0C717 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 865979F8EA297777D5EE61555BE150EA /* Yams.debug.xcconfig */;
+ buildSettings = {
+ ARCHS = "$(ARCHS_STANDARD_64_BIT)";
+ CODE_SIGN_IDENTITY = "";
+ "CODE_SIGN_IDENTITY[sdk=appletvos*]" = "";
+ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
+ "CODE_SIGN_IDENTITY[sdk=watchos*]" = "";
+ COMBINE_HIDPI_IMAGES = YES;
+ CURRENT_PROJECT_VERSION = 1;
+ DEFINES_MODULE = YES;
+ DYLIB_COMPATIBILITY_VERSION = 1;
+ DYLIB_CURRENT_VERSION = 1;
+ DYLIB_INSTALL_NAME_BASE = "@rpath";
+ FRAMEWORK_VERSION = A;
+ GCC_PREFIX_HEADER = "Target Support Files/Yams/Yams-prefix.pch";
+ INFOPLIST_FILE = "Target Support Files/Yams/Yams-Info.plist";
+ INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
+ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks";
+ MACOSX_DEPLOYMENT_TARGET = 10.9;
+ MODULEMAP_FILE = "Target Support Files/Yams/Yams.modulemap";
+ PRODUCT_MODULE_NAME = Yams;
+ PRODUCT_NAME = Yams;
+ SDKROOT = macosx;
+ SKIP_INSTALL = YES;
+ SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) ";
+ SWIFT_VERSION = 5.2;
+ VERSIONING_SYSTEM = "apple-generic";
+ VERSION_INFO_PREFIX = "";
+ };
+ name = Debug;
+ };
24DF9D5C61A659E23B2FB62F98B7264D /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
@@ -342,6 +375,39 @@
};
name = Debug;
};
+ 97C2DE5EC81AD5776952497BFB10297A /* Release */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 6D9F019076020D02421A6AAF1B5DE9F5 /* Yams.release.xcconfig */;
+ buildSettings = {
+ ARCHS = "$(ARCHS_STANDARD_64_BIT)";
+ CODE_SIGN_IDENTITY = "";
+ "CODE_SIGN_IDENTITY[sdk=appletvos*]" = "";
+ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
+ "CODE_SIGN_IDENTITY[sdk=watchos*]" = "";
+ COMBINE_HIDPI_IMAGES = YES;
+ CURRENT_PROJECT_VERSION = 1;
+ DEFINES_MODULE = YES;
+ DYLIB_COMPATIBILITY_VERSION = 1;
+ DYLIB_CURRENT_VERSION = 1;
+ DYLIB_INSTALL_NAME_BASE = "@rpath";
+ FRAMEWORK_VERSION = A;
+ GCC_PREFIX_HEADER = "Target Support Files/Yams/Yams-prefix.pch";
+ INFOPLIST_FILE = "Target Support Files/Yams/Yams-Info.plist";
+ INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
+ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks";
+ MACOSX_DEPLOYMENT_TARGET = 10.9;
+ MODULEMAP_FILE = "Target Support Files/Yams/Yams.modulemap";
+ PRODUCT_MODULE_NAME = Yams;
+ PRODUCT_NAME = Yams;
+ SDKROOT = macosx;
+ SKIP_INSTALL = YES;
+ SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) ";
+ SWIFT_VERSION = 5.2;
+ VERSIONING_SYSTEM = "apple-generic";
+ VERSION_INFO_PREFIX = "";
+ };
+ name = Release;
+ };
A30BF41CC6824A3EF1C7337C2B8612DC /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
@@ -402,80 +468,14 @@
};
name = Release;
};
- E439FE7162F57FCC7260684514991B9B /* Debug */ = {
- isa = XCBuildConfiguration;
- baseConfigurationReference = 865979F8EA297777D5EE61555BE150EA /* Yams.debug.xcconfig */;
- buildSettings = {
- ARCHS = "$(ARCHS_STANDARD_64_BIT)";
- CODE_SIGN_IDENTITY = "";
- "CODE_SIGN_IDENTITY[sdk=appletvos*]" = "";
- "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
- "CODE_SIGN_IDENTITY[sdk=watchos*]" = "";
- COMBINE_HIDPI_IMAGES = YES;
- CURRENT_PROJECT_VERSION = 1;
- DEFINES_MODULE = YES;
- DYLIB_COMPATIBILITY_VERSION = 1;
- DYLIB_CURRENT_VERSION = 1;
- DYLIB_INSTALL_NAME_BASE = "@rpath";
- FRAMEWORK_VERSION = A;
- GCC_PREFIX_HEADER = "Target Support Files/Yams/Yams-prefix.pch";
- INFOPLIST_FILE = "Target Support Files/Yams/Yams-Info.plist";
- INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
- LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks";
- MACOSX_DEPLOYMENT_TARGET = 10.9;
- MODULEMAP_FILE = "Target Support Files/Yams/Yams.modulemap";
- PRODUCT_MODULE_NAME = Yams;
- PRODUCT_NAME = Yams;
- SDKROOT = macosx;
- SKIP_INSTALL = YES;
- SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) ";
- SWIFT_VERSION = 5.0;
- VERSIONING_SYSTEM = "apple-generic";
- VERSION_INFO_PREFIX = "";
- };
- name = Debug;
- };
- E70B328A81330C9F14688FDF43411048 /* Release */ = {
- isa = XCBuildConfiguration;
- baseConfigurationReference = 6D9F019076020D02421A6AAF1B5DE9F5 /* Yams.release.xcconfig */;
- buildSettings = {
- ARCHS = "$(ARCHS_STANDARD_64_BIT)";
- CODE_SIGN_IDENTITY = "";
- "CODE_SIGN_IDENTITY[sdk=appletvos*]" = "";
- "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
- "CODE_SIGN_IDENTITY[sdk=watchos*]" = "";
- COMBINE_HIDPI_IMAGES = YES;
- CURRENT_PROJECT_VERSION = 1;
- DEFINES_MODULE = YES;
- DYLIB_COMPATIBILITY_VERSION = 1;
- DYLIB_CURRENT_VERSION = 1;
- DYLIB_INSTALL_NAME_BASE = "@rpath";
- FRAMEWORK_VERSION = A;
- GCC_PREFIX_HEADER = "Target Support Files/Yams/Yams-prefix.pch";
- INFOPLIST_FILE = "Target Support Files/Yams/Yams-Info.plist";
- INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
- LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks";
- MACOSX_DEPLOYMENT_TARGET = 10.9;
- MODULEMAP_FILE = "Target Support Files/Yams/Yams.modulemap";
- PRODUCT_MODULE_NAME = Yams;
- PRODUCT_NAME = Yams;
- SDKROOT = macosx;
- SKIP_INSTALL = YES;
- SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) ";
- SWIFT_VERSION = 5.0;
- VERSIONING_SYSTEM = "apple-generic";
- VERSION_INFO_PREFIX = "";
- };
- name = Release;
- };
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
226CD7D944A159C68F4DEE9F87579DF6 /* Build configuration list for PBXNativeTarget "Yams" */ = {
isa = XCConfigurationList;
buildConfigurations = (
- E439FE7162F57FCC7260684514991B9B /* Debug */,
- E70B328A81330C9F14688FDF43411048 /* Release */,
+ 021BAC56583E0E45F775510BC5B0C717 /* Debug */,
+ 97C2DE5EC81AD5776952497BFB10297A /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
diff --git a/Pods/Yams/README.md b/Pods/Yams/README.md
index a08b47b6..9b187367 100644
--- a/Pods/Yams/README.md
+++ b/Pods/Yams/README.md
@@ -5,19 +5,40 @@
A sweet and swifty [YAML](http://yaml.org/) parser built on
[LibYAML](https://github.com/yaml/libyaml).
-[](https://dev.azure.com/jpsim/Yams/_build/latest?definitionId=1)
+[](https://github.com/jpsim/Yams/actions?query=workflow%3ASwiftPM)
+[](https://github.com/jpsim/Yams/actions?query=workflow%3Axcodebuild)
+[](https://github.com/jpsim/Yams/actions?query=workflow%3A%22pod+lib+lint%22)
+[](https://github.com/jpsim/Yams/actions?query=workflow%3ANightly)
+[](https://codecov.io/gh/jpsim/Yams)
## Installation
-Building Yams on macOS requires Xcode 9.x/10.x or a Swift 3.2/4.x/5.x toolchain
-with the Swift Package Manager.
+Building Yams requires Xcode 10.x or a Swift 4.1+/5.x toolchain with the
+Swift Package Manager or CMake and Ninja.
-Building Yams on Linux requires a Swift 4.x/5.x compiler and Swift Package
-Manager to be installed.
+### CMake
+
+CMake 3.17.2 or newer is required, along with Ninja 1.9.0 or newer.
+
+When building for non-Apple platforms:
+
+```
+cmake -B /path/to/build -G Ninja -S /path/to/yams -DCMAKE_BUILD_TYPE=Release -DFoundation_DIR=/path/to/foundation/build/cmake/modules
+cmake --build /path/to/build
+```
+
+To build for Apple platforms (macOS, iOS, tvOS, watchOS), there is no
+need to spearately build Foundation because it is included as part of
+the SDK:
+
+```
+cmake -B /path/to/build -G Ninja -S /path/to/yams -DCMAKE_BUILD_TYPE=Release
+cmake --build /path/to/build
+```
### Swift Package Manager
-Add `.package(url: "https://github.com/jpsim/Yams.git", from: "2.0.0")` to your
+Add `.package(url: "https://github.com/jpsim/Yams.git", from: "3.0.1")` to your
`Package.swift` file's `dependencies`.
### CocoaPods
diff --git a/Pods/Yams/Sources/CYaml/include/yaml.h b/Pods/Yams/Sources/CYaml/include/yaml.h
index 92f6b5cb..11823364 100644
--- a/Pods/Yams/Sources/CYaml/include/yaml.h
+++ b/Pods/Yams/Sources/CYaml/include/yaml.h
@@ -232,7 +232,7 @@ typedef enum yaml_token_type_e {
/** A BLOCK-SEQUENCE-START token. */
YAML_BLOCK_SEQUENCE_START_TOKEN,
- /** A BLOCK-SEQUENCE-END token. */
+ /** A BLOCK-MAPPING-START token. */
YAML_BLOCK_MAPPING_START_TOKEN,
/** A BLOCK-END token. */
YAML_BLOCK_END_TOKEN,
@@ -552,7 +552,7 @@ yaml_document_end_event_initialize(yaml_event_t *event, int implicit);
*/
YAML_DECLARE(int)
-yaml_alias_event_initialize(yaml_event_t *event, yaml_char_t *anchor);
+yaml_alias_event_initialize(yaml_event_t *event, const yaml_char_t *anchor);
/**
* Create a SCALAR event.
@@ -578,8 +578,8 @@ yaml_alias_event_initialize(yaml_event_t *event, yaml_char_t *anchor);
YAML_DECLARE(int)
yaml_scalar_event_initialize(yaml_event_t *event,
- yaml_char_t *anchor, yaml_char_t *tag,
- yaml_char_t *value, int length,
+ const yaml_char_t *anchor, const yaml_char_t *tag,
+ const yaml_char_t *value, int length,
int plain_implicit, int quoted_implicit,
yaml_scalar_style_t style);
@@ -601,7 +601,7 @@ yaml_scalar_event_initialize(yaml_event_t *event,
YAML_DECLARE(int)
yaml_sequence_start_event_initialize(yaml_event_t *event,
- yaml_char_t *anchor, yaml_char_t *tag, int implicit,
+ const yaml_char_t *anchor, const yaml_char_t *tag, int implicit,
yaml_sequence_style_t style);
/**
@@ -633,7 +633,7 @@ yaml_sequence_end_event_initialize(yaml_event_t *event);
YAML_DECLARE(int)
yaml_mapping_start_event_initialize(yaml_event_t *event,
- yaml_char_t *anchor, yaml_char_t *tag, int implicit,
+ const yaml_char_t *anchor, const yaml_char_t *tag, int implicit,
yaml_mapping_style_t style);
/**
@@ -896,7 +896,7 @@ yaml_document_get_root_node(yaml_document_t *document);
YAML_DECLARE(int)
yaml_document_add_scalar(yaml_document_t *document,
- yaml_char_t *tag, yaml_char_t *value, int length,
+ const yaml_char_t *tag, const yaml_char_t *value, int length,
yaml_scalar_style_t style);
/**
@@ -913,7 +913,7 @@ yaml_document_add_scalar(yaml_document_t *document,
YAML_DECLARE(int)
yaml_document_add_sequence(yaml_document_t *document,
- yaml_char_t *tag, yaml_sequence_style_t style);
+ const yaml_char_t *tag, yaml_sequence_style_t style);
/**
* Create a MAPPING node and attach it to the document.
@@ -929,7 +929,7 @@ yaml_document_add_sequence(yaml_document_t *document,
YAML_DECLARE(int)
yaml_document_add_mapping(yaml_document_t *document,
- yaml_char_t *tag, yaml_mapping_style_t style);
+ const yaml_char_t *tag, yaml_mapping_style_t style);
/**
* Add an item to a SEQUENCE node.
@@ -1517,6 +1517,18 @@ typedef enum yaml_emitter_state_e {
YAML_EMIT_END_STATE
} yaml_emitter_state_t;
+
+/* This is needed for C++ */
+
+typedef struct yaml_anchors_s {
+ /** The number of references. */
+ int references;
+ /** The anchor id. */
+ int anchor;
+ /** If the node has been emitted? */
+ int serialized;
+} yaml_anchors_t;
+
/**
* The emitter structure.
*
@@ -1742,14 +1754,7 @@ typedef struct yaml_emitter_s {
int closed;
/** The information associated with the document nodes. */
- struct {
- /** The number of references. */
- int references;
- /** The anchor id. */
- int anchor;
- /** If the node has been emitted? */
- int serialized;
- } *anchors;
+ yaml_anchors_t *anchors;
/** The last assigned anchor id. */
int last_anchor_id;
@@ -1853,7 +1858,7 @@ YAML_DECLARE(void)
yaml_emitter_set_canonical(yaml_emitter_t *emitter, int canonical);
/**
- * Set the intendation increment.
+ * Set the indentation increment.
*
* @param[in,out] emitter An emitter object.
* @param[in] indent The indentation increment (1 < . < 10).
@@ -1940,8 +1945,8 @@ yaml_emitter_close(yaml_emitter_t *emitter);
*
* The documen object may be generated using the yaml_parser_load() function
* or the yaml_document_initialize() function. The emitter takes the
- * responsibility for the document object and destoys its content after
- * it is emitted. The document object is destroyedeven if the function fails.
+ * responsibility for the document object and destroys its content after
+ * it is emitted. The document object is destroyed even if the function fails.
*
* @param[in,out] emitter An emitter object.
* @param[in,out] document A document object.
diff --git a/Pods/Yams/Sources/CYaml/src/api.c b/Pods/Yams/Sources/CYaml/src/api.c
index cd3478a3..1ddd9294 100644
--- a/Pods/Yams/Sources/CYaml/src/api.c
+++ b/Pods/Yams/Sources/CYaml/src/api.c
@@ -601,10 +601,10 @@ yaml_token_delete(yaml_token_t *token)
*/
static int
-yaml_check_utf8(yaml_char_t *start, size_t length)
+yaml_check_utf8(const yaml_char_t *start, size_t length)
{
- yaml_char_t *end = start+length;
- yaml_char_t *pointer = start;
+ const yaml_char_t *end = start+length;
+ const yaml_char_t *pointer = start;
while (pointer < end) {
unsigned char octet;
@@ -772,7 +772,7 @@ yaml_document_end_event_initialize(yaml_event_t *event, int implicit)
*/
YAML_DECLARE(int)
-yaml_alias_event_initialize(yaml_event_t *event, yaml_char_t *anchor)
+yaml_alias_event_initialize(yaml_event_t *event, const yaml_char_t *anchor)
{
yaml_mark_t mark = { 0, 0, 0 };
yaml_char_t *anchor_copy = NULL;
@@ -797,8 +797,8 @@ yaml_alias_event_initialize(yaml_event_t *event, yaml_char_t *anchor)
YAML_DECLARE(int)
yaml_scalar_event_initialize(yaml_event_t *event,
- yaml_char_t *anchor, yaml_char_t *tag,
- yaml_char_t *value, int length,
+ const yaml_char_t *anchor, const yaml_char_t *tag,
+ const yaml_char_t *value, int length,
int plain_implicit, int quoted_implicit,
yaml_scalar_style_t style)
{
@@ -854,7 +854,7 @@ error:
YAML_DECLARE(int)
yaml_sequence_start_event_initialize(yaml_event_t *event,
- yaml_char_t *anchor, yaml_char_t *tag, int implicit,
+ const yaml_char_t *anchor, const yaml_char_t *tag, int implicit,
yaml_sequence_style_t style)
{
yaml_mark_t mark = { 0, 0, 0 };
@@ -909,7 +909,7 @@ yaml_sequence_end_event_initialize(yaml_event_t *event)
YAML_DECLARE(int)
yaml_mapping_start_event_initialize(yaml_event_t *event,
- yaml_char_t *anchor, yaml_char_t *tag, int implicit,
+ const yaml_char_t *anchor, const yaml_char_t *tag, int implicit,
yaml_mapping_style_t style)
{
yaml_mark_t mark = { 0, 0, 0 };
@@ -1174,7 +1174,7 @@ yaml_document_get_root_node(yaml_document_t *document)
YAML_DECLARE(int)
yaml_document_add_scalar(yaml_document_t *document,
- yaml_char_t *tag, yaml_char_t *value, int length,
+ const yaml_char_t *tag, const yaml_char_t *value, int length,
yaml_scalar_style_t style)
{
struct {
@@ -1230,7 +1230,7 @@ error:
YAML_DECLARE(int)
yaml_document_add_sequence(yaml_document_t *document,
- yaml_char_t *tag, yaml_sequence_style_t style)
+ const yaml_char_t *tag, yaml_sequence_style_t style)
{
struct {
yaml_error_type_t error;
@@ -1278,7 +1278,7 @@ error:
YAML_DECLARE(int)
yaml_document_add_mapping(yaml_document_t *document,
- yaml_char_t *tag, yaml_mapping_style_t style)
+ const yaml_char_t *tag, yaml_mapping_style_t style)
{
struct {
yaml_error_type_t error;
diff --git a/Pods/Yams/Sources/CYaml/src/emitter.c b/Pods/Yams/Sources/CYaml/src/emitter.c
index b9392e40..f26c53b9 100644
--- a/Pods/Yams/Sources/CYaml/src/emitter.c
+++ b/Pods/Yams/Sources/CYaml/src/emitter.c
@@ -1227,7 +1227,7 @@ yaml_emitter_select_scalar_style(yaml_emitter_t *emitter, yaml_event_t *event)
}
/*
- * Write an achor.
+ * Write an anchor.
*/
static int
diff --git a/Pods/Yams/Sources/CYaml/src/scanner.c b/Pods/Yams/Sources/CYaml/src/scanner.c
index c0f95576..ce138c17 100644
--- a/Pods/Yams/Sources/CYaml/src/scanner.c
+++ b/Pods/Yams/Sources/CYaml/src/scanner.c
@@ -3521,12 +3521,12 @@ yaml_parser_scan_plain_scalar(yaml_parser_t *parser, yaml_token_t *token)
{
if (IS_BLANK(parser->buffer))
{
- /* Check for tab character that abuse indentation. */
+ /* Check for tab characters that abuse indentation. */
if (leading_blanks && (int)parser->mark.column < indent
&& IS_TAB(parser->buffer)) {
yaml_parser_set_scanner_error(parser, "while scanning a plain scalar",
- start_mark, "found a tab character that violate indentation");
+ start_mark, "found a tab character that violates indentation");
goto error;
}
diff --git a/Pods/Yams/Sources/Yams/Constructor.swift b/Pods/Yams/Sources/Yams/Constructor.swift
index 69aab123..12882752 100644
--- a/Pods/Yams/Sources/Yams/Constructor.swift
+++ b/Pods/Yams/Sources/Yams/Constructor.swift
@@ -115,6 +115,19 @@ public protocol ScalarConstructible {
static func construct(from scalar: Node.Scalar) -> Self?
}
+// MARK: - ScalarConstructible UUID Conformance
+
+extension UUID: ScalarConstructible {
+ /// Construct an instance of `UUID`, if possible, from the specified scalar.
+ ///
+ /// - parameter scalar: The `Node.Scalar` from which to extract a value of type `UUID`, if possible.
+ ///
+ /// - returns: An instance of `UUID`, if one was successfully extracted from the scalar.
+ public static func construct(from scalar: Node.Scalar) -> UUID? {
+ return UUID(uuidString: scalar.string)
+ }
+}
+
// MARK: - ScalarConstructible Bool Conformance
extension Bool: ScalarConstructible {
@@ -167,24 +180,24 @@ extension Date: ScalarConstructible {
}
var datecomponents = DateComponents()
- datecomponents.calendar = Calendar(identifier: .gregorian)
+ datecomponents.calendar = gregorianCalendar
datecomponents.year = components[0].flatMap { Int($0) }
datecomponents.month = components[1].flatMap { Int($0) }
datecomponents.day = components[2].flatMap { Int($0) }
datecomponents.hour = components[3].flatMap { Int($0) }
datecomponents.minute = components[4].flatMap { Int($0) }
datecomponents.second = components[5].flatMap { Int($0) }
- datecomponents.nanosecond = components[6].flatMap { fraction in
+ let nanoseconds: TimeInterval? = components[6].flatMap { fraction in
let length = fraction.count
- let nanosecond: Int?
+ let nanoseconds: Int?
if length < 9 {
- nanosecond = Int(fraction).map { number in
+ nanoseconds = Int(fraction).map { number in
repeatElement(10, count: 9 - length).reduce(number, *)
}
} else {
- nanosecond = Int(fraction[.. [AnyHashable: Any] {
- let mapping = flatten_mapping(mapping)
+ let mapping = mapping.flatten()
+ // TODO: YAML supports keys other than str.
+#if swift(>=5.0)
+ return [AnyHashable: Any](
+ mapping.map { (String.construct(from: $0.key)!, mapping.tag.constructor.any(from: $0.value)) },
+ uniquingKeysWith: { _, second in second }
+ )
+#else
var dictionary = [AnyHashable: Any](minimumCapacity: mapping.count)
mapping.forEach {
- // TODO: YAML supports keys other than str.
dictionary[String.construct(from: $0.key)!] = mapping.tag.constructor.any(from: $0.value)
}
return dictionary
- }
-
- private static func flatten_mapping(_ mapping: Node.Mapping) -> Node.Mapping {
- var pairs = Array(mapping)
- var merge = [(key: Node, value: Node)]()
- var index = pairs.startIndex
- while index < pairs.count {
- let pair = pairs[index]
- if pair.key.tag.name == .merge {
- pairs.remove(at: index)
- switch pair.value {
- case .mapping(let mapping):
- merge.append(contentsOf: flatten_mapping(mapping))
- case let .sequence(sequence):
- let submerge = sequence
- .compactMap { $0.mapping.map(flatten_mapping) }
- .reversed()
- submerge.forEach {
- merge.append(contentsOf: $0)
- }
- default:
- break // TODO: Should raise error on other than mapping or sequence
- }
- } else if pair.key.tag.name == .value {
- pair.key.tag.name = .str
- index += 1
- } else {
- index += 1
- }
- }
- return Node.Mapping(merge + pairs, mapping.tag, mapping.style)
+#endif
}
}
@@ -450,8 +439,7 @@ extension Set {
// TODO: YAML supports Hashable elements other than str.
return Set(mapping.map({ String.construct(from: $0.key)! as AnyHashable }))
// Explicitly declaring the generic parameter as `` above is required,
- // because this is inside extension of `Set` and Swift 3.0.2 to 4.1.0 can't infer the type without
- // that.
+ // because this is inside extension of `Set` and Swift can't infer the type without that.
}
}
@@ -509,18 +497,6 @@ private extension String {
}
}
-private extension StringProtocol {
-#if swift(>=4.1)
- func substring(from offset: Int) -> SubSequence {
- return self[index(startIndex, offsetBy: offset)...]
- }
-#else
- func substring(from offset: IndexDistance) -> SubSequence {
- return self[index(startIndex, offsetBy: offset)...]
- }
-#endif
-}
-
// MARK: - SexagesimalConvertible
/// Confirming types are convertible to base 60 numeric values.
@@ -602,9 +578,9 @@ private extension String {
let sign: T
if scalar.hasPrefix("-") {
sign = -1
- scalar = String(scalar.substring(from: 1))
+ scalar = String(scalar.dropFirst())
} else if scalar.hasPrefix("+") {
- scalar = String(scalar.substring(from: 1))
+ scalar = String(scalar.dropFirst())
sign = 1
} else {
sign = 1
diff --git a/Pods/Yams/Sources/Yams/Decoder.swift b/Pods/Yams/Sources/Yams/Decoder.swift
index 460e6f2c..c5e93a70 100644
--- a/Pods/Yams/Sources/Yams/Decoder.swift
+++ b/Pods/Yams/Sources/Yams/Decoder.swift
@@ -31,7 +31,7 @@ public class YAMLDecoder {
from yaml: String,
userInfo: [CodingUserInfoKey: Any] = [:]) throws -> T where T: Swift.Decodable {
do {
- let node = try Parser(yaml: yaml, resolver: .basic, encoding: encoding).singleRoot() ?? ""
+ let node = try Parser(yaml: yaml, resolver: Resolver([.merge]), encoding: encoding).singleRoot() ?? ""
let decoder = _Decoder(referencing: node, userInfo: userInfo)
let container = try decoder.singleValueContainer()
return try container.decode(type)
@@ -64,7 +64,7 @@ private struct _Decoder: Decoder {
let userInfo: [CodingUserInfoKey: Any]
func container(keyedBy type: Key.Type) throws -> KeyedDecodingContainer {
- guard let mapping = node.mapping else {
+ guard let mapping = node.mapping?.flatten() else {
throw _typeMismatch(at: codingPath, expectation: Node.Mapping.self, reality: node)
}
return .init(_KeyedDecodingContainer(decoder: self, wrapping: mapping))
@@ -99,7 +99,7 @@ private struct _Decoder: Decoder {
}
}
-private struct _KeyedDecodingContainer : KeyedDecodingContainerProtocol {
+private struct _KeyedDecodingContainer: KeyedDecodingContainerProtocol {
private let decoder: _Decoder
private let mapping: Node.Mapping
diff --git a/Pods/Yams/Sources/Yams/Emitter.swift b/Pods/Yams/Sources/Yams/Emitter.swift
index 1b5850d7..ec3d1413 100644
--- a/Pods/Yams/Sources/Yams/Emitter.swift
+++ b/Pods/Yams/Sources/Yams/Emitter.swift
@@ -330,15 +330,15 @@ public final class Emitter {
throw YamlError.emitter(problem: "serializer is closed")
}
var event = yaml_event_t()
- var versionDirective: UnsafeMutablePointer?
- var versionDirectiveValue = yaml_version_directive_t()
if let (major, minor) = options.version {
- versionDirectiveValue.major = Int32(major)
- versionDirectiveValue.minor = Int32(minor)
- versionDirective = UnsafeMutablePointer(&versionDirectiveValue)
+ var versionDirective = yaml_version_directive_t(major: Int32(major), minor: Int32(minor))
+ // TODO: Support tags
+ yaml_document_start_event_initialize(&event, &versionDirective, nil, nil, options.explicitStart ? 0 : 1)
+ } else {
+ // TODO: Support tags
+ yaml_document_start_event_initialize(&event, nil, nil, nil, options.explicitStart ? 0 : 1)
}
- // TODO: Support tags
- yaml_document_start_event_initialize(&event, versionDirective, nil, nil, options.explicitStart ? 0 : 1)
+
try emit(&event)
try serializeNode(node)
yaml_document_end_event_initialize(&event, options.explicitEnd ? 0 : 1)
@@ -411,7 +411,11 @@ extension Emitter {
private func serializeScalar(_ scalar: Node.Scalar) throws {
var value = scalar.string.utf8CString, tag = scalar.resolvedTag.name.rawValue.utf8CString
+#if os(Windows)
+ let scalarStyle = yaml_scalar_style_t(rawValue: Int32(scalar.style.rawValue))
+#else
let scalarStyle = yaml_scalar_style_t(rawValue: scalar.style.rawValue)
+#endif
var event = yaml_event_t()
_ = value.withUnsafeMutableBytes { value in
tag.withUnsafeMutableBytes { tag in
@@ -432,7 +436,11 @@ extension Emitter {
private func serializeSequence(_ sequence: Node.Sequence) throws {
var tag = sequence.resolvedTag.name.rawValue.utf8CString
let implicit: Int32 = sequence.tag.name == .seq ? 1 : 0
+#if os(Windows)
+ let sequenceStyle = yaml_sequence_style_t(rawValue: Int32(sequence.style.rawValue))
+#else
let sequenceStyle = yaml_sequence_style_t(rawValue: sequence.style.rawValue)
+#endif
var event = yaml_event_t()
_ = tag.withUnsafeMutableBytes { tag in
yaml_sequence_start_event_initialize(
@@ -451,7 +459,11 @@ extension Emitter {
private func serializeMapping(_ mapping: Node.Mapping) throws {
var tag = mapping.resolvedTag.name.rawValue.utf8CString
let implicit: Int32 = mapping.tag.name == .map ? 1 : 0
+#if os(Windows)
+ let mappingStyle = yaml_mapping_style_t(rawValue: Int32(mapping.style.rawValue))
+#else
let mappingStyle = yaml_mapping_style_t(rawValue: mapping.style.rawValue)
+#endif
var event = yaml_event_t()
_ = tag.withUnsafeMutableBytes { tag in
yaml_mapping_start_event_initialize(
diff --git a/Pods/Yams/Sources/Yams/Encoder.swift b/Pods/Yams/Sources/Yams/Encoder.swift
index 07694751..42f5aa42 100644
--- a/Pods/Yams/Sources/Yams/Encoder.swift
+++ b/Pods/Yams/Sources/Yams/Encoder.swift
@@ -136,7 +136,7 @@ private class _ReferencingEncoder: _Encoder {
}
}
-private struct _KeyedEncodingContainer : KeyedEncodingContainerProtocol {
+private struct _KeyedEncodingContainer: KeyedEncodingContainerProtocol {
private let encoder: _Encoder
diff --git a/Pods/Yams/Sources/Yams/Node.Mapping.swift b/Pods/Yams/Sources/Yams/Node.Mapping.swift
index 198dde22..9acf0ce2 100644
--- a/Pods/Yams/Sources/Yams/Node.Mapping.swift
+++ b/Pods/Yams/Sources/Yams/Node.Mapping.swift
@@ -137,6 +137,41 @@ extension Node.Mapping: TagResolvable {
static let defaultTagName = Tag.Name.map
}
+// MARK: - Merge support
+
+extension Node.Mapping {
+ func flatten() -> Node.Mapping {
+ var pairs = Array(self)
+ var merge = [(key: Node, value: Node)]()
+ var index = pairs.startIndex
+ while index < pairs.count {
+ let pair = pairs[index]
+ if pair.key.tag.name == .merge {
+ pairs.remove(at: index)
+ switch pair.value {
+ case .mapping(let mapping):
+ merge.append(contentsOf: mapping.flatten())
+ case let .sequence(sequence):
+ let submerge = sequence
+ .compactMap { $0.mapping.map { $0.flatten() } }
+ .reversed()
+ submerge.forEach {
+ merge.append(contentsOf: $0)
+ }
+ default:
+ break // TODO: Should raise error on other than mapping or sequence
+ }
+ } else if pair.key.tag.name == .value {
+ pair.key.tag.name = .str
+ index += 1
+ } else {
+ index += 1
+ }
+ }
+ return Node.Mapping(merge + pairs, tag, style)
+ }
+}
+
// MARK: - Dictionary-like APIs
extension Node.Mapping {
@@ -145,7 +180,7 @@ extension Node.Mapping {
return lazy.map { $0.key }
}
- /// This mapping's keys. Similar to `Dictionary.keys`.
+ /// This mapping's values. Similar to `Dictionary.values`.
public var values: LazyMapCollection {
return lazy.map { $0.value }
}
diff --git a/Pods/Yams/Sources/Yams/Node.swift b/Pods/Yams/Sources/Yams/Node.swift
index d6da117e..9da761f9 100644
--- a/Pods/Yams/Sources/Yams/Node.swift
+++ b/Pods/Yams/Sources/Yams/Node.swift
@@ -112,6 +112,11 @@ extension Node {
return scalar.flatMap(Date.construct)
}
+ /// This node as a `UUID`, if convertible.
+ public var uuid: UUID? {
+ return scalar.flatMap(UUID.construct)
+ }
+
// MARK: Typed accessor methods
/// Returns this node mapped as an `Array`. If the node isn't a `Node.sequence`, the array will be
@@ -297,12 +302,6 @@ extension Node: ExpressibleByStringLiteral {
extension Node {
// MARK: Internal convenience accessors
- var isScalar: Bool {
- if case .scalar = self {
- return true
- }
- return false
- }
var isMapping: Bool {
if case .mapping = self {
diff --git a/Pods/Yams/Sources/Yams/Parser.swift b/Pods/Yams/Sources/Yams/Parser.swift
index e0883cdc..bf367754 100644
--- a/Pods/Yams/Sources/Yams/Parser.swift
+++ b/Pods/Yams/Sources/Yams/Parser.swift
@@ -351,8 +351,13 @@ private class Event {
return string(from: event.data.scalar.anchor)
}
var scalarStyle: Node.Scalar.Style {
+#if os(Windows)
+ // swiftlint:disable:next force_unwrapping
+ return Node.Scalar.Style(rawValue: UInt32(event.data.scalar.style.rawValue))!
+#else
// swiftlint:disable:next force_unwrapping
return Node.Scalar.Style(rawValue: event.data.scalar.style.rawValue)!
+#endif
}
var scalarTag: String? {
if event.data.scalar.quoted_implicit == 1 {
@@ -373,8 +378,13 @@ private class Event {
return string(from: event.data.sequence_start.anchor)
}
var sequenceStyle: Node.Sequence.Style {
+#if os(Windows)
+ // swiftlint:disable:next force_unwrapping
+ return Node.Sequence.Style(rawValue: UInt32(event.data.sequence_start.style.rawValue))!
+#else
// swiftlint:disable:next force_unwrapping
return Node.Sequence.Style(rawValue: event.data.sequence_start.style.rawValue)!
+#endif
}
var sequenceTag: String? {
return event.data.sequence_start.implicit != 0
@@ -386,8 +396,13 @@ private class Event {
return string(from: event.data.scalar.anchor)
}
var mappingStyle: Node.Mapping.Style {
+#if os(Windows)
+ // swiftlint:disable:next force_unwrapping
+ return Node.Mapping.Style(rawValue: UInt32(event.data.mapping_start.style.rawValue))!
+#else
// swiftlint:disable:next force_unwrapping
return Node.Mapping.Style(rawValue: event.data.mapping_start.style.rawValue)!
+#endif
}
var mappingTag: String? {
return event.data.mapping_start.implicit != 0
diff --git a/Pods/Yams/Sources/Yams/Representer.swift b/Pods/Yams/Sources/Yams/Representer.swift
index 94fdf551..37f96f44 100644
--- a/Pods/Yams/Sources/Yams/Representer.swift
+++ b/Pods/Yams/Sources/Yams/Representer.swift
@@ -6,9 +6,6 @@
// Copyright (c) 2017 Yams. All rights reserved.
//
-#if SWIFT_PACKAGE
-import CYaml
-#endif
#if os(Linux)
import CoreFoundation
#endif
@@ -56,9 +53,7 @@ extension Dictionary: NodeRepresentable {
}
private func represent(_ value: Any) throws -> Node {
- if let string = value as? String {
- return Node(string)
- } else if let representable = value as? NodeRepresentable {
+ if let representable = value as? NodeRepresentable {
return try representable.represented()
}
throw YamlError.representer(problem: "Failed to represent \(value)")
@@ -78,6 +73,13 @@ extension ScalarRepresentable {
}
}
+extension NSNull: ScalarRepresentable {
+ /// This value's `Node.scalar` representation.
+ public func represented() -> Node.Scalar {
+ return .init("null", Tag(.null))
+ }
+}
+
extension Bool: ScalarRepresentable {
/// This value's `Node.scalar` representation.
public func represented() -> Node.Scalar {
@@ -99,31 +101,38 @@ extension Date: ScalarRepresentable {
}
private var iso8601String: String {
-#if !_runtime(_ObjC) && !swift(>=5.0)
- // swift-corelibs-foundation has bug with nanosecond.
- // https://bugs.swift.org/browse/SR-3158
- return iso8601Formatter.string(from: self)
-#else
- let calendar = Calendar(identifier: .gregorian)
- let nanosecond = calendar.component(.nanosecond, from: self)
- if nanosecond != 0 {
- return iso8601WithFractionalSecondFormatter.string(from: self)
- .trimmingCharacters(in: characterSetZero) + "Z"
- } else {
- return iso8601Formatter.string(from: self)
- }
-#endif
+ let (integral, millisecond) = timeIntervalSinceReferenceDate.separateFractionalSecond(withPrecision: 3)
+ guard millisecond != 0 else { return iso8601Formatter.string(from: self) }
+
+ let dateWithoutMillisecond = Date(timeIntervalSinceReferenceDate: integral)
+ return iso8601WithoutZFormatter.string(from: dateWithoutMillisecond) +
+ String(format: ".%03d", millisecond).trimmingCharacters(in: characterSetZero) + "Z"
}
private var iso8601StringWithFullNanosecond: String {
- let calendar = Calendar(identifier: .gregorian)
- let nanosecond = calendar.component(.nanosecond, from: self)
- if nanosecond != 0 {
- return iso8601WithoutZFormatter.string(from: self) +
- String(format: ".%09d", nanosecond).trimmingCharacters(in: characterSetZero) + "Z"
- } else {
- return iso8601Formatter.string(from: self)
- }
+ let (integral, nanosecond) = timeIntervalSinceReferenceDate.separateFractionalSecond(withPrecision: 9)
+ guard nanosecond != 0 else { return iso8601Formatter.string(from: self) }
+
+ let dateWithoutNanosecond = Date(timeIntervalSinceReferenceDate: integral)
+ return iso8601WithoutZFormatter.string(from: dateWithoutNanosecond) +
+ String(format: ".%09d", nanosecond).trimmingCharacters(in: characterSetZero) + "Z"
+ }
+}
+
+private extension TimeInterval {
+ /// Separates the time interval into integral and fractional components, then rounds the `fractional`
+ /// component to `precision` number of digits.
+ ///
+ /// - returns: Tuple of integral part and converted fractional part
+ func separateFractionalSecond(withPrecision precision: Int) -> (integral: TimeInterval, fractional: Int) {
+ var integral = 0.0
+ let fractional = modf(self, &integral)
+ let radix = pow(10.0, Double(precision))
+ let rounded = Int((fractional * radix).rounded())
+ let quotient = rounded / Int(radix)
+ return quotient != 0 ? // carry-up?
+ (integral + TimeInterval(quotient), rounded % Int(radix)) :
+ (integral, rounded)
}
}
@@ -145,15 +154,6 @@ private let iso8601WithoutZFormatter: DateFormatter = {
return formatter
}()
-// DateFormatter truncates Fractional Second to 10^-4
-private let iso8601WithFractionalSecondFormatter: DateFormatter = {
- var formatter = DateFormatter()
- formatter.locale = Locale(identifier: "en_US_POSIX")
- formatter.dateFormat = "yyyy'-'MM'-'dd'T'HH':'mm':'ss.SSSS"
- formatter.timeZone = TimeZone(secondsFromGMT: 0)
- return formatter
-}()
-
extension Double: ScalarRepresentable {
/// This value's `Node.scalar` representation.
public func represented() -> Node.Scalar {
@@ -234,11 +234,19 @@ extension URL: ScalarRepresentable {
extension String: ScalarRepresentable {
/// This value's `Node.scalar` representation.
public func represented() -> Node.Scalar {
- return .init(self)
+ let scalar = Node.Scalar(self)
+ return scalar.resolvedTag.name == .str ? scalar : .init(self, Tag(.str), .singleQuoted)
}
}
-/// MARK: - ScalarRepresentableCustomizedForCodable
+extension UUID: ScalarRepresentable {
+ /// This value's `Node.scalar` representation.
+ public func represented() -> Node.Scalar {
+ return .init(uuidString)
+ }
+}
+
+// MARK: - ScalarRepresentableCustomizedForCodable
/// Types conforming to this protocol can be encoded by `YamlEncoder`.
public protocol YAMLEncodable: Encodable {
@@ -268,6 +276,7 @@ extension UInt32: YAMLEncodable {}
extension UInt64: YAMLEncodable {}
extension URL: YAMLEncodable {}
extension String: YAMLEncodable {}
+extension UUID: YAMLEncodable {}
extension Date: YAMLEncodable {
/// Returns this value wrapped in a `Node.scalar`.
diff --git a/Pods/Yams/Sources/Yams/Resolver.swift b/Pods/Yams/Sources/Yams/Resolver.swift
index 193df890..40abb2da 100644
--- a/Pods/Yams/Sources/Yams/Resolver.swift
+++ b/Pods/Yams/Sources/Yams/Resolver.swift
@@ -14,7 +14,7 @@ public final class Resolver {
public struct Rule {
/// The tag name this rule applies to.
public let tag: Tag.Name
- internal let regexp: NSRegularExpression
+ fileprivate let regexp: NSRegularExpression
/// The regex pattern used to resolve this rule.
public var pattern: String { return regexp.pattern }
diff --git a/Pods/Yams/Sources/Yams/Tag.swift b/Pods/Yams/Sources/Yams/Tag.swift
index e3314518..fae8a0b2 100644
--- a/Pods/Yams/Sources/Yams/Tag.swift
+++ b/Pods/Yams/Sources/Yams/Tag.swift
@@ -6,10 +6,6 @@
// Copyright (c) 2016 Yams. All rights reserved.
//
-#if SWIFT_PACKAGE
-import CYaml
-#endif
-
/// Tags describe the the _type_ of a Node.
public final class Tag {
/// Tag name.
@@ -57,7 +53,7 @@ public final class Tag {
let constructor: Constructor
var name: Name
- func resolved(with value: T) -> Tag where T: TagResolvable {
+ fileprivate func resolved(with value: T) -> Tag where T: TagResolvable {
if name == .implicit {
name = resolver.resolveTag(of: value)
} else if name == .nonSpecific {
diff --git a/Pods/Yams/Sources/Yams/shim.swift b/Pods/Yams/Sources/Yams/shim.swift
index 87b0574c..5f67742d 100644
--- a/Pods/Yams/Sources/Yams/shim.swift
+++ b/Pods/Yams/Sources/Yams/shim.swift
@@ -6,16 +6,6 @@
// Copyright (c) 2018 Yams. All rights reserved.
//
-#if !swift(>=4.1)
-extension Sequence {
- func compactMap(
- _ transform: (Self.Element
- ) throws -> ElementOfResult?) rethrows -> [ElementOfResult] {
- return try flatMap(transform)
- }
-}
-#endif
-
#if !_runtime(_ObjC) && !swift(>=4.2)
extension Substring {
func hasPrefix(_ prefix: String) -> Bool {
diff --git a/Sources/SwiftGenKit/Utils/YamsSerialization.swift b/Sources/SwiftGenKit/Utils/YamsSerialization.swift
index 9c424492..afa1e087 100644
--- a/Sources/SwiftGenKit/Utils/YamsSerialization.swift
+++ b/Sources/SwiftGenKit/Utils/YamsSerialization.swift
@@ -52,12 +52,6 @@ extension NSData: ScalarRepresentable {
}
}
-extension NSNull: ScalarRepresentable {
- public func represented() -> Node.Scalar {
- Node.Scalar("null", Tag(.null))
- }
-}
-
extension NSNumber: ScalarRepresentable {
public func represented() -> Node.Scalar {
if let value = Bool(exactly: self) {
diff --git a/SwiftGenKit.podspec b/SwiftGenKit.podspec
index c9d52a1c..7706a7cb 100644
--- a/SwiftGenKit.podspec
+++ b/SwiftGenKit.podspec
@@ -30,6 +30,6 @@ Pod::Spec.new do |s|
s.dependency 'Kanna', '~> 5.2'
s.dependency 'PathKit', '~> 0.9'
- s.dependency 'Yams', '~> 2.0'
+ s.dependency 'Yams', '~> 3.0'
s.framework = 'Foundation'
end