@@ -283,7 +283,14 @@ private void CollapseRightAndLeft(string operation, int operationBeginIndex, out
283283 var cacheKey = span . Slice ( operationIndex - outParsedLength + 1 , outParsedLength - 2 ) ;
284284 var cachedItem = _parentExpression . State . GetPlaceholderCacheItem ( cacheKey ) ;
285285 isUserVariableDerived = cachedItem . IsUserVariableDerived ;
286- _parentExpression . State . IncrementScanStep ( ) ;
286+
287+ _parentExpression . State . StoreScanStep ( new ScanStepItem
288+ {
289+ Value = cachedItem . ComputedValue ,
290+ Length = outParsedLength ,
291+ IsValid = ! isUserVariableDerived
292+ } ) ;
293+
287294 return cachedItem . ComputedValue ;
288295 }
289296 else
@@ -311,7 +318,8 @@ private void CollapseRightAndLeft(string operation, int operationBeginIndex, out
311318 _parentExpression . State . StoreScanStep ( new ScanStepItem
312319 {
313320 Value = result ,
314- Length = outParsedLength
321+ Length = outParsedLength ,
322+ IsValid = true
315323 } ) ;
316324
317325 return result ;
@@ -344,7 +352,14 @@ private void CollapseRightAndLeft(string operation, int operationBeginIndex, out
344352 outParsedLength = i ;
345353 var cachedItem = _parentExpression . State . GetPlaceholderCacheItem ( span . Slice ( 1 , i - 2 ) ) ;
346354 isUserVariableDerived = cachedItem . IsUserVariableDerived ;
347- _parentExpression . State . IncrementScanStep ( ) ;
355+
356+ _parentExpression . State . StoreScanStep ( new ScanStepItem
357+ {
358+ Value = cachedItem . ComputedValue ,
359+ Length = outParsedLength ,
360+ IsValid = ! isUserVariableDerived
361+ } ) ;
362+
348363 return cachedItem . ComputedValue ;
349364 }
350365 else
@@ -365,7 +380,8 @@ private void CollapseRightAndLeft(string operation, int operationBeginIndex, out
365380 _parentExpression . State . StoreScanStep ( new ScanStepItem
366381 {
367382 Value = result ,
368- Length = outParsedLength
383+ Length = outParsedLength ,
384+ IsValid = true
369385 } ) ;
370386
371387 return result ;
0 commit comments