From 1412466e935d9620a5bff0a31e8b7d6038b91c4c Mon Sep 17 00:00:00 2001 From: John-Colvin Date: Tue, 4 Dec 2012 12:02:33 +0000 Subject: [PATCH] modified: dyaml/constructor.d modified: dyaml/dumper.d modified: dyaml/emitter.d modified: dyaml/exception.d modified: dyaml/node.d modified: dyaml/parser.d modified: dyaml/representer.d modified: dyaml/scanner.d modified: dyaml/zerostring.d --- dyaml/constructor.d | 2 +- dyaml/dumper.d | 2 +- dyaml/emitter.d | 2 +- dyaml/exception.d | 8 ++++---- dyaml/node.d | 8 ++++---- dyaml/parser.d | 2 +- dyaml/representer.d | 2 +- dyaml/scanner.d | 2 +- dyaml/zerostring.d | 2 +- 9 files changed, 15 insertions(+), 15 deletions(-) diff --git a/dyaml/constructor.d b/dyaml/constructor.d index 039c8d5..95ebbab 100644 --- a/dyaml/constructor.d +++ b/dyaml/constructor.d @@ -46,7 +46,7 @@ package class ConstructorException : YAMLException * end = End position of the error context. */ this(string msg, Mark start, Mark end, string file = __FILE__, int line = __LINE__) - @safe nothrow + @safe { super(msg ~ "\nstart: " ~ start.toString() ~ "\nend: " ~ end.toString(), file, line); diff --git a/dyaml/dumper.d b/dyaml/dumper.d index 9b404b9..7126fcf 100644 --- a/dyaml/dumper.d +++ b/dyaml/dumper.d @@ -167,7 +167,7 @@ struct Dumper } ///Construct a Dumper writing to a _stream. This is useful to e.g. write to memory. - this(Stream stream) pure @safe nothrow + this(Stream stream) pure @safe { resolver_ = new Resolver(); representer_ = new Representer(); diff --git a/dyaml/emitter.d b/dyaml/emitter.d index 5751193..70178a2 100644 --- a/dyaml/emitter.d +++ b/dyaml/emitter.d @@ -166,7 +166,7 @@ struct Emitter * lineBreak = Line break character/s. */ this(Stream stream, const bool canonical, const int indent, const int width, - const LineBreak lineBreak) @trusted nothrow + const LineBreak lineBreak) @trusted in{assert(stream.writeable, "Can't emit YAML to a non-writable stream");} body { diff --git a/dyaml/exception.d b/dyaml/exception.d index ddca5af..2421ccf 100644 --- a/dyaml/exception.d +++ b/dyaml/exception.d @@ -58,7 +58,7 @@ abstract class MarkedYAMLException : YAMLException { //Construct a MarkedYAMLException with specified context and problem. this(string context, Mark contextMark, string problem, Mark problemMark, - string file = __FILE__, int line = __LINE__) @safe nothrow + string file = __FILE__, int line = __LINE__) @safe { const msg = context ~ '\n' ~ (contextMark != problemMark ? contextMark.toString() ~ '\n' : "") ~ @@ -68,7 +68,7 @@ abstract class MarkedYAMLException : YAMLException //Construct a MarkedYAMLException with specified problem. this(string problem, Mark problemMark, string file = __FILE__, int line = __LINE__) - @safe nothrow + @safe { super(problem ~ '\n' ~ problemMark.toString(), file, line); } @@ -89,14 +89,14 @@ template MarkedExceptionCtors() { public: this(string context, Mark contextMark, string problem, Mark problemMark, - string file = __FILE__, int line = __LINE__) @safe nothrow + string file = __FILE__, int line = __LINE__) @safe { super(context, contextMark, problem, problemMark, file, line); } this(string problem, Mark problemMark, string file = __FILE__, int line = __LINE__) - @safe nothrow + @safe { super(problem, problemMark, file, line); } diff --git a/dyaml/node.d b/dyaml/node.d index 7f07abd..38afc8c 100644 --- a/dyaml/node.d +++ b/dyaml/node.d @@ -40,7 +40,7 @@ class NodeException : YAMLException * start = Start position of the node. */ this(string msg, Mark start, string file = __FILE__, int line = __LINE__) - @safe nothrow + @safe { super(msg ~ "\nNode at: " ~ start.toString(), file, line); } @@ -144,7 +144,7 @@ struct Node @disable int opCmp(ref Pair); ///Construct a Pair from two values. Will be converted to Nodes if needed. - this(K, V)(K key, V value) @safe + this(K, V)(K key, V value) @trusted { static if(is(Unqual!K == Node)){this.key = key;} else {this.key = Node(key);} @@ -1742,7 +1742,7 @@ package: * Params: pairs = Array of pairs to merge into. * toMerge = Pair to merge. */ -void merge(ref Node.Pair[] pairs, ref Node.Pair toMerge) @safe +void merge(ref Node.Pair[] pairs, Node.Pair toMerge) @safe { foreach(ref pair; pairs) { @@ -1760,7 +1760,7 @@ void merge(ref Node.Pair[] pairs, ref Node.Pair toMerge) @safe * Params: pairs = Array of pairs to merge into. * toMerge = Pairs to merge. */ -void merge(ref Node.Pair[] pairs, Node.Pair[] toMerge) @safe +void merge(ref Node.Pair[] pairs, Node.Pair[] toMerge) @trusted { bool eq(ref Node.Pair a, ref Node.Pair b){return a.key == b.key;} diff --git a/dyaml/parser.d b/dyaml/parser.d index 9d531dc..126a312 100644 --- a/dyaml/parser.d +++ b/dyaml/parser.d @@ -135,7 +135,7 @@ final class Parser public: ///Construct a Parser using specified Scanner. - this(Scanner scanner) @trusted nothrow + this(Scanner scanner) @trusted { state_ = &parseStreamStart; scanner_ = scanner; diff --git a/dyaml/representer.d b/dyaml/representer.d index 99a3630..a3c242d 100644 --- a/dyaml/representer.d +++ b/dyaml/representer.d @@ -523,7 +523,7 @@ Node representSysTime(ref Node node, Representer representer) @system } ///Represent a sequence _node as sequence/set. -Node representNodes(ref Node node, Representer representer) @safe +Node representNodes(ref Node node, Representer representer) @trusted { auto nodes = node.as!(Node[]); if(node.tag_ == Tag("tag:yaml.org,2002:set")) diff --git a/dyaml/scanner.d b/dyaml/scanner.d index acaedb3..2482619 100644 --- a/dyaml/scanner.d +++ b/dyaml/scanner.d @@ -152,7 +152,7 @@ final class Scanner public: ///Construct a Scanner using specified Reader. - this(Reader reader) @trusted nothrow + this(Reader reader) @trusted { //Return the next token, but do not delete it from the queue reader_ = reader; diff --git a/dyaml/zerostring.d b/dyaml/zerostring.d index ecaeb21..841a097 100644 --- a/dyaml/zerostring.d +++ b/dyaml/zerostring.d @@ -44,7 +44,7 @@ struct ZeroString(string TypeName) } ///Test for equality with another string. - bool opEquals(const ref ZeroString str) const nothrow @trusted + bool opEquals(const ZeroString str) const nothrow @trusted { return isNull ? str.isNull : str.isNull ? false : (0 == strcmp(str_, str.str_));