diff options
author | Ralph Amissah <ralph.amissah@gmail.com> | 2023-06-04 20:24:27 -0400 |
---|---|---|
committer | Ralph Amissah <ralph.amissah@gmail.com> | 2023-06-04 20:24:27 -0400 |
commit | 7973da975eac7cf5155a140e4cb4f68d5cbb1eb9 (patch) | |
tree | 447a05d248c217b75b97c497d0a172204eeb8d7f /src/ext_depends/D-YAML/source/dyaml/exception.d | |
parent | nix use overlays when convenient (diff) |
make set_depends (dyaml update)
Diffstat (limited to 'src/ext_depends/D-YAML/source/dyaml/exception.d')
-rw-r--r-- | src/ext_depends/D-YAML/source/dyaml/exception.d | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/src/ext_depends/D-YAML/source/dyaml/exception.d b/src/ext_depends/D-YAML/source/dyaml/exception.d index 15e9c61..145e9c3 100644 --- a/src/ext_depends/D-YAML/source/dyaml/exception.d +++ b/src/ext_depends/D-YAML/source/dyaml/exception.d @@ -19,7 +19,7 @@ class YAMLException : Exception { /// Construct a YAMLException with specified message and position where it was thrown. public this(string msg, string file = __FILE__, size_t line = __LINE__) - @safe pure nothrow + @safe pure nothrow @nogc { super(msg, file, line); } @@ -65,8 +65,14 @@ struct Mark return column_; } + /// Duplicate a mark + Mark dup () const scope @safe pure nothrow + { + return Mark(this.name_.idup, this.line_, this.column_); + } + /// Get a string representation of the mark. - string toString() @safe pure nothrow const + string toString() const scope @safe pure nothrow { // Line/column numbers start at zero internally, make them start at 1. static string clamped(ushort v) @safe pure nothrow @@ -84,23 +90,24 @@ abstract class MarkedYAMLException : YAMLException Mark mark; // Construct a MarkedYAMLException with specified context and problem. - this(string context, const Mark contextMark, string problem, const Mark problemMark, + this(string context, scope const Mark contextMark, + string problem, scope const Mark problemMark, string file = __FILE__, size_t line = __LINE__) @safe pure nothrow { const msg = context ~ '\n' ~ (contextMark != problemMark ? contextMark.toString() ~ '\n' : "") ~ problem ~ '\n' ~ problemMark.toString() ~ '\n'; super(msg, file, line); - mark = problemMark; + mark = problemMark.dup; } // Construct a MarkedYAMLException with specified problem. - this(string problem, const Mark problemMark, + this(string problem, scope const Mark problemMark, string file = __FILE__, size_t line = __LINE__) @safe pure nothrow { super(problem ~ '\n' ~ problemMark.toString(), file, line); - mark = problemMark; + mark = problemMark.dup; } /// Construct a MarkedYAMLException from a struct storing constructor parameters. |