コード例 #1
0
        private bool CheckNotFalsePositive(string line, int matchOffset, string searchString)
        {
            if (matchOffset > 0)
            {
                //begin of match is begin of word
                var previousChar = line[matchOffset - 1];
                if (FortranParseHelper.IsWordCharacter(previousChar))
                {
                    return(false);
                }
            }
            var endOfMatch = searchString.Length + matchOffset;

            if (endOfMatch < line.Length)
            {
                //end of match is end of word
                var nextChar = line[endOfMatch];
                if (FortranParseHelper.IsWordCharacter(nextChar))
                {
                    return(false);
                }
            }

            return(!FortranParseHelper.IsIndexInsideCharacterString(line, matchOffset));
        }