Alsing.SourceCode.Pattern.SimpleFindKeyword C# (CSharp) Method

SimpleFindKeyword() private method

private SimpleFindKeyword ( string text, int startPosition, bool matchCase ) : PatternScanResult
text string
startPosition int
matchCase bool
return PatternScanResult
        private PatternScanResult SimpleFindKeyword( string text, int startPosition,
                                                    bool matchCase)
        {
            PatternScanResult res;
            while (true)
            {
                res = this.SimpleFind(text, startPosition, matchCase);
                if (res.Token == "")
                    return res;

                if (this.CharIsSeparator(text, res.Index - 1) && this.CharIsSeparator(text, res.Index + res.Token.Length))
                    return res;

                startPosition = res.Index + 1;
                if (startPosition >= text.Length)
                {
                    res.Token = "";
                    res.Index = 0;
                    return res;
                }
            }
        }