public CharCheckEntry MatchSuccess(OptimizationContext context, Instruction instruction) { var matching = MatchingCharacters.Clone(); AddEntry(instruction, true, instruction.Offset, matching); matching[instruction.Offset].RemoveAll(existing => InstructionHelper.NonJumpMatchWillFail(context, existing, instruction)); return(new CharCheckEntry(matching, FailingCharacters)); }
public NdState MatchSuccess(OptimizationContext context, Instruction instruction, int offset) { var matching = MatchingCharacters.Clone(); AddEntry(instruction, true, offset, matching); matching[offset].RemoveAll(existing => InstructionHelper.NonJumpMatchWillFail(context, existing, instruction)); return(new NdState(Variable, Vug, PositionA, PositionB, AdvancesA, AdvancesB, MinBounds, MaxBounds, VarAs, VarBs, matching, FailingCharacters)); }
public CharCheckEntry Advance(int offset) { var matching = MatchingCharacters.Clone(); var failing = FailingCharacters.Clone(); for (var i = 0; i < offset; i++) { if (matching.Count > 0) { matching.PopFront(); } if (failing.Count > 0) { failing.PopFront(); } } return(new CharCheckEntry(matching, failing)); }