private static void SkipUntilMatchingClosingBrace(ref FastString script)
{
int braceIndent = 1, index = 1;
while ((braceIndent > 0) && (index < script.Length))
{
if (IncrementIndexToSkipAnyComments(script, ref index))
{
break;
}
if ((script[index] == '"') || (script[index] == '\''))
{
char firstChar = script[index];
index++;
while (index < script.Length - 1)
{
if ((script[index] == firstChar) &&
((script[index - 1] != '\\') || (script[index - 2] == '\\')))
{
break;
}
index++;
}
}
if (script[index] == '{')
{
braceIndent++;
}
else if (script[index] == '}')
{
braceIndent--;
}
index++;
}
script = script.Substring(index);
}