Use of throwIfError for handling scanPlain errors.

This commit is contained in:
Ferdinand Majerech 2014-07-24 18:43:33 +02:00
parent 60c3079f11
commit 45d8db08d1

View file

@ -726,16 +726,12 @@ final class Scanner
// change this flag if the scan is finished at the beginning of the line. // change this flag if the scan is finished at the beginning of the line.
allowSimpleKey_ = false; allowSimpleKey_ = false;
const plain = scanPlain(); const plain = scanPlain();
if(error_) throwIfError();
{
error_ = false;
throw new Error(errorData_);
}
// Scan and add SCALAR. May change allowSimpleKey_ // Scan and add SCALAR. May change allowSimpleKey_
tokens_.push(plain); tokens_.push(plain);
} }
///Check if the next token is DIRECTIVE: ^ '%' ... ///Check if the next token is DIRECTIVE: ^ '%' ...
bool checkDirective() @safe pure nothrow @nogc bool checkDirective() @safe pure nothrow @nogc
{ {