BitOrchestra.Parser.AcceptExtendedWhitespace C# (CSharp) Method

AcceptExtendedWhitespace() public static method

Tries parsing extended whitespace (whitespace, comments, newlines) in the given text.
public static AcceptExtendedWhitespace ( string Text, int &Index ) : bool
Text string
Index int
return bool
        public static bool AcceptExtendedWhitespace(string Text, ref int Index)
        {
            bool found = false;
            while (AcceptWhitespace(Text, ref Index))
            {
                found = true;
                bool multiline = false;
                if (AcceptComment(Text, ref Index, ref multiline) && multiline)
                    continue;
                break;
            }

            while (AcceptNewline(Text, ref Index))
            {
                bool multiline = false;
                found = true;
                AcceptWhitespace(Text, ref Index);
                while (AcceptComment(Text, ref Index, ref multiline) && multiline)
                {
                    AcceptWhitespace(Text, ref Index);
                }
            }

            return found;
        }