make Scanner a struct
This commit is contained in:
parent
c61f569f19
commit
d6300bc52e
|
@ -152,7 +152,7 @@ struct Loader
|
|||
try
|
||||
{
|
||||
reader_ = new Reader(yamlData);
|
||||
scanner_ = new Scanner(reader_);
|
||||
scanner_ = Scanner(reader_);
|
||||
parser_ = new Parser(scanner_);
|
||||
}
|
||||
catch(YAMLException e)
|
||||
|
|
|
@ -95,7 +95,22 @@ public:
|
|||
@disable bool opEquals(ref Queue);
|
||||
@disable int opCmp(ref Queue);
|
||||
|
||||
@disable this(this);
|
||||
this(this) @safe nothrow @nogc
|
||||
{
|
||||
auto node = first_;
|
||||
first_ = null;
|
||||
last_ = null;
|
||||
while (node !is null)
|
||||
{
|
||||
Node* newLast = makeNewNode(node.payload_);
|
||||
if (last_ !is null)
|
||||
last_.next_ = newLast;
|
||||
if (first_ is null)
|
||||
first_ = newLast;
|
||||
last_ = newLast;
|
||||
node = node.next_;
|
||||
}
|
||||
}
|
||||
|
||||
~this() @safe nothrow @nogc
|
||||
{
|
||||
|
|
|
@ -79,7 +79,7 @@ class ScannerException : MarkedYAMLException
|
|||
}
|
||||
|
||||
/// Generates tokens from data provided by a Reader.
|
||||
final class Scanner
|
||||
struct Scanner
|
||||
{
|
||||
private:
|
||||
/// A simple key is a key that is not denoted by the '?' indicator.
|
||||
|
|
Loading…
Reference in a new issue