diff --git a/YamlDotNet/Core/Scanner.cs b/YamlDotNet/Core/Scanner.cs index 1ba45ceba..6d0138a92 100644 --- a/YamlDotNet/Core/Scanner.cs +++ b/YamlDotNet/Core/Scanner.cs @@ -1785,9 +1785,10 @@ private void FetchQuotedScalar(bool isSingleQuoted) flowScalarFetched = flowLevel > 0; // Create the SCALAR token and append it to the queue. + var scalar = ScanFlowScalar(isSingleQuoted); - tokens.Enqueue(ScanFlowScalar(isSingleQuoted)); - + tokens.Enqueue(scalar); + lastScalar = scalar; // Check if there is a comment subsequently after double-quoted scalar without space. if (!isSingleQuoted && analyzer.Check('#')) @@ -1801,7 +1802,7 @@ private void FetchQuotedScalar(bool isSingleQuoted) /// Scan a quoted scalar. /// - private Token ScanFlowScalar(bool isSingleQuoted) + private Scalar ScanFlowScalar(bool isSingleQuoted) { // Eat the left quote.