From 36e7954756a9b3034e8c34da1161152fd6ae0d85 Mon Sep 17 00:00:00 2001 From: Ferdinand Majerech Date: Wed, 23 Jul 2014 18:28:57 +0200 Subject: [PATCH] Code calling scanPlain() assumes scanPlain() writes exception into errorData_. --- source/dyaml/scanner.d | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/source/dyaml/scanner.d b/source/dyaml/scanner.d index 9f7daca..270e45a 100644 --- a/source/dyaml/scanner.d +++ b/source/dyaml/scanner.d @@ -701,9 +701,14 @@ final class Scanner //No simple keys after plain scalars. But note that scanPlain() will //change this flag if the scan is finished at the beginning of the line. allowSimpleKey_ = false; - + const plain = scanPlain(); + if(error_) + { + error_ = false; + throw new Error(errorData_); + } //Scan and add SCALAR. May change allowSimpleKey_ - tokens_.push(scanPlain()); + tokens_.push(plain); }