if(offset != lastOffset)
return false;
} //}}}
int matchedChars = 1;
CharIndexedSegment charIndexed = null;
REMatch match = null;
//{{{ See if the rule's start or end sequence matches here
if(!end || (checkRule.action & ParserRule.MARK_FOLLOWING) == 0)
{
// the end cannot be a regular expression
if((checkRule.action & ParserRule.REGEXP) == 0 || end)
{
if(end)
{
if(context.spanEndSubst != null)
pattern.array = context.spanEndSubst;
else
pattern.array = checkRule.end;
}
else
pattern.array = checkRule.start;
pattern.offset = 0;
pattern.count = pattern.array.length;
matchedChars = pattern.count;
if(!SyntaxUtilities.regionMatches(context.rules
.getIgnoreCase(),line,pos,pattern.array))
{
return false;
}
}
else
{
// note that all regexps start with \A so they only
// match the start of the string
int matchStart = pos - line.offset;
charIndexed = new CharIndexedSegment(line,matchStart);
match = checkRule.startRegexp.getMatch(
charIndexed,0,RE.REG_ANCHORINDEX);
if(match == null)
return false;
else if(match.getStartIndex() != 0)