protected override void ApplyToSpecificElement(ref int index, IList <IElement> elements, Stack <BranchStackFrame> branchStack, DecompilationContext context) { var individualContext = new IndividualDecompilationContext(elements, branchStack); var element = elements[index]; var indexFixed = index; var interpretation = this.Interpretations.FirstOrDefault(x => x.CanInterpret(elements[indexFixed])); if (interpretation == null) { return; } individualContext.CurrentIndex = index; var result = interpretation.Interpret(element, individualContext); index = individualContext.CurrentIndex; // some elements may have been captured, changing the collection, so index resync is needed if (result != null) { elements[index] = result; } else { elements.RemoveAt(index); index -= 1; } }
protected override void ApplyToSpecificElement(ref int index, IList<IElement> elements, Stack<BranchStackFrame> branchStack, DecompilationContext context) { var individualContext = new IndividualDecompilationContext(elements, branchStack); var element = elements[index]; var indexFixed = index; var interpretation = this.Interpretations.FirstOrDefault(x => x.CanInterpret(elements[indexFixed])); if (interpretation == null) return; individualContext.CurrentIndex = index; var result = interpretation.Interpret(element, individualContext); index = individualContext.CurrentIndex; // some elements may have been captured, changing the collection, so index resync is needed if (result != null) { elements[index] = result; } else { elements.RemoveAt(index); index -= 1; } }