public void Visit(DecrementTag decrementTag) { _result += decrementTag.ToString(); }
/// <summary> /// Pre-decrement the counter, i.e. --i /// </summary> public void Visit(DecrementTag decrementTag) { int currentIndex; var key = decrementTag.VarName; while (true) { currentIndex = _counters.GetOrAdd(key, 0); var newindex = (currentIndex - 1); if (_counters.TryUpdate(key, newindex, currentIndex)) { currentIndex = newindex; break; } } AppendTextToCurrentAccumulator(currentIndex.ToString()); }