Merge pull request #263 from tom-tan/make-startMark-public
Add `Node.startMark`
This commit is contained in:
commit
22267baaa7
|
@ -25,8 +25,7 @@ class YAMLException : Exception
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
package:
|
/// Position in a YAML stream, used for error messages.
|
||||||
// Position in a YAML stream, used for error messages.
|
|
||||||
struct Mark
|
struct Mark
|
||||||
{
|
{
|
||||||
package:
|
package:
|
||||||
|
@ -45,6 +44,18 @@ struct Mark
|
||||||
column_ = cast(ushort)column;
|
column_ = cast(ushort)column;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Get a line number.
|
||||||
|
@property ushort line() @safe pure nothrow @nogc const
|
||||||
|
{
|
||||||
|
return line_;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Get a column number.
|
||||||
|
@property ushort column() @safe pure nothrow @nogc const
|
||||||
|
{
|
||||||
|
return column_;
|
||||||
|
}
|
||||||
|
|
||||||
/// Get a string representation of the mark.
|
/// Get a string representation of the mark.
|
||||||
string toString() @safe pure nothrow const
|
string toString() @safe pure nothrow const
|
||||||
{
|
{
|
||||||
|
@ -57,6 +68,7 @@ struct Mark
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
package:
|
||||||
// A struct storing parameters to the MarkedYAMLException constructor.
|
// A struct storing parameters to the MarkedYAMLException constructor.
|
||||||
struct MarkedYAMLExceptionData
|
struct MarkedYAMLExceptionData
|
||||||
{
|
{
|
||||||
|
|
|
@ -402,6 +402,12 @@ struct Node
|
||||||
return tag_;
|
return tag_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Return the start position of the node.
|
||||||
|
@property Mark startMark() const @safe pure nothrow
|
||||||
|
{
|
||||||
|
return startMark_;
|
||||||
|
}
|
||||||
|
|
||||||
/** Equality test.
|
/** Equality test.
|
||||||
*
|
*
|
||||||
* If T is Node, recursively compares all subnodes.
|
* If T is Node, recursively compares all subnodes.
|
||||||
|
|
Loading…
Reference in a new issue