public override int Matches(int stringIndex, String testString, MatchResultImpl matchResult) { int end = matchResult.GetEnd(groupIndex); matchResult.SetEnd(groupIndex, stringIndex); int shift = next.Matches(stringIndex, testString, matchResult); /* * if(shift >=0 && matchResult.getEnd(groupIndex) == -1) { * matchResult.setEnd(groupIndex, stringIndex); } */ if (shift < 0) { matchResult.SetEnd(groupIndex, end); } return(shift); }
public override bool HasConsumed(MatchResultImpl matchResult) { return(!(matchResult.GetEnd(groupIndex) >= 0 && matchResult .GetStart(groupIndex) == matchResult.GetEnd(groupIndex))); }