aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/ext_depends/D-YAML/source/dyaml
diff options
context:
space:
mode:
Diffstat (limited to 'src/ext_depends/D-YAML/source/dyaml')
-rw-r--r--src/ext_depends/D-YAML/source/dyaml/dumper.d13
-rw-r--r--src/ext_depends/D-YAML/source/dyaml/emitter.d2
-rw-r--r--src/ext_depends/D-YAML/source/dyaml/exception.d28
-rw-r--r--src/ext_depends/D-YAML/source/dyaml/parser.d2
-rw-r--r--src/ext_depends/D-YAML/source/dyaml/representer.d8
5 files changed, 32 insertions, 21 deletions
diff --git a/src/ext_depends/D-YAML/source/dyaml/dumper.d b/src/ext_depends/D-YAML/source/dyaml/dumper.d
index 51f232f..03d3620 100644
--- a/src/ext_depends/D-YAML/source/dyaml/dumper.d
+++ b/src/ext_depends/D-YAML/source/dyaml/dumper.d
@@ -228,7 +228,7 @@ struct Dumper
dumper.explicitStart = false;
dumper.YAMLVersion = null;
dumper.dump(stream, node);
- assert(stream.data == "[!!str 'Hello world!', [!!str 'Hello', !!str 'world!']]\n");
+ assert(stream.data == "['Hello world!', ['Hello', 'world!']]\n");
}
// Explicit document start/end markers
@safe unittest
@@ -245,6 +245,17 @@ struct Dumper
//account for newline at end
assert(stream.data[$-4..$-1] == "...");
}
+@safe unittest
+{
+ auto stream = new Appender!string();
+ auto node = Node([Node("Te, st2")]);
+ auto dumper = dumper();
+ dumper.explicitStart = true;
+ dumper.explicitEnd = false;
+ dumper.YAMLVersion = null;
+ dumper.dump(stream, node);
+ assert(stream.data == "--- ['Te, st2']\n");
+}
// No explicit document start/end markers
@safe unittest
{
diff --git a/src/ext_depends/D-YAML/source/dyaml/emitter.d b/src/ext_depends/D-YAML/source/dyaml/emitter.d
index a436c7c..5cf6a92 100644
--- a/src/ext_depends/D-YAML/source/dyaml/emitter.d
+++ b/src/ext_depends/D-YAML/source/dyaml/emitter.d
@@ -774,7 +774,7 @@ struct Emitter(Range, CharType) if (isOutputRange!(Range, CharType))
{
if(style_ == ScalarStyle.invalid){style_ = chooseScalarStyle();}
if((!canonical_ || (tag is null)) &&
- (style_ == ScalarStyle.plain ? event_.implicit : !event_.implicit && (tag is null)))
+ ((tag == "tag:yaml.org,2002:str") || (style_ == ScalarStyle.plain ? event_.implicit : !event_.implicit && (tag is null))))
{
preparedTag_ = null;
return;
diff --git a/src/ext_depends/D-YAML/source/dyaml/exception.d b/src/ext_depends/D-YAML/source/dyaml/exception.d
index 46d3047..15e9c61 100644
--- a/src/ext_depends/D-YAML/source/dyaml/exception.d
+++ b/src/ext_depends/D-YAML/source/dyaml/exception.d
@@ -77,20 +77,6 @@ struct Mark
}
}
-package:
-// A struct storing parameters to the MarkedYAMLException constructor.
-struct MarkedYAMLExceptionData
-{
- // Context of the error.
- string context;
- // Position of the context in a YAML buffer.
- Mark contextMark;
- // The error itself.
- string problem;
- // Position if the error.
- Mark problemMark;
-}
-
// Base class of YAML exceptions with marked positions of the problem.
abstract class MarkedYAMLException : YAMLException
{
@@ -124,6 +110,20 @@ abstract class MarkedYAMLException : YAMLException
}
}
+package:
+// A struct storing parameters to the MarkedYAMLException constructor.
+struct MarkedYAMLExceptionData
+{
+ // Context of the error.
+ string context;
+ // Position of the context in a YAML buffer.
+ Mark contextMark;
+ // The error itself.
+ string problem;
+ // Position if the error.
+ Mark problemMark;
+}
+
// Constructors of YAML exceptions are mostly the same, so we use a mixin.
//
// See_Also: YAMLException
diff --git a/src/ext_depends/D-YAML/source/dyaml/parser.d b/src/ext_depends/D-YAML/source/dyaml/parser.d
index 7e0b78a..befdfa4 100644
--- a/src/ext_depends/D-YAML/source/dyaml/parser.d
+++ b/src/ext_depends/D-YAML/source/dyaml/parser.d
@@ -25,7 +25,6 @@ import dyaml.token;
import dyaml.tagdirective;
-package:
/**
* The following YAML grammar is LL(1) and is parsed by a recursive descent
* parser.
@@ -99,6 +98,7 @@ class ParserException : MarkedYAMLException
mixin MarkedExceptionCtors;
}
+package:
/// Generates events from tokens provided by a Scanner.
///
/// While Parser receives tokens with non-const character slices, the events it
diff --git a/src/ext_depends/D-YAML/source/dyaml/representer.d b/src/ext_depends/D-YAML/source/dyaml/representer.d
index 98c825b..f903b60 100644
--- a/src/ext_depends/D-YAML/source/dyaml/representer.d
+++ b/src/ext_depends/D-YAML/source/dyaml/representer.d
@@ -91,7 +91,9 @@ Node representData(const Node data, ScalarStyle defaultScalarStyle, CollectionSt
{
result.collectionStyle = defaultCollectionStyle;
}
+ break;
case NodeID.invalid:
+ break;
}
@@ -123,7 +125,7 @@ Node representData(const Node data, ScalarStyle defaultScalarStyle, CollectionSt
@safe unittest
{
- assert(representData(Node(cast(string)null), ScalarStyle.invalid, CollectionStyle.invalid) == Node("null", "tag:yaml.org,2002:null"));
+ assert(representData(Node(cast(string)null), ScalarStyle.invalid, CollectionStyle.invalid) == Node("", "tag:yaml.org,2002:str"));
assert(representData(Node("Hello world!"), ScalarStyle.invalid, CollectionStyle.invalid) == Node("Hello world!", "tag:yaml.org,2002:str"));
}
@@ -289,9 +291,7 @@ Node representNull() @safe
Node representString(const Node node) @safe
{
string value = node.as!string;
- return value is null
- ? Node("null", "tag:yaml.org,2002:null")
- : Node(value, "tag:yaml.org,2002:str");
+ return Node(value, "tag:yaml.org,2002:str");
}
//Represent a bytes _node as a binary scalar.