AGS.Editor.AutoComplete.IncrementIndexToSkipAnyComments C# (CSharp) Метод

IncrementIndexToSkipAnyComments() приватный статический Метод

private static IncrementIndexToSkipAnyComments ( FastString script, int &index ) : bool
script AGS.CScript.Compiler.FastString
index int
Результат bool
        private static bool IncrementIndexToSkipAnyComments(FastString script, ref int index)
        {
            while (index < script.Length - 1 && (script[index] == '/'))
            {
                if ((script[index + 1] == '/'))
                {
                    index = script.IndexOf('\r', index + 2);
                    if (index < 0)
                    {
                        index = script.Length;
                    }
                }
                else
                {
                    if ((script[index + 1] == '*'))
                    {
                        index = script.IndexOf("*/", index + 2);
                        if (index < 0)
                        {
                            index = script.Length;
                        }
                    }
                    else
                    {
                        break;
                    }
                }
            }
            return index == script.Length;
        }