Exemple #1
0
        static void CheckQuotesIndices(ParsingScript script,
                                       char ch, ref bool inQuotes, ref int arrayIndexDepth)
        {
            switch (ch)
            {
            case Constants.QUOTE:
            {
                char prev     = script.TryPrevPrev();
                char prevprev = script.TryPrevPrevPrev();
                inQuotes = (prev != '\\' || prevprev == '\\') ? !inQuotes : inQuotes;
                return;
            }

            case Constants.START_ARRAY:
            {
                if (!inQuotes)
                {
                    arrayIndexDepth++;
                }
                return;
            }

            case Constants.END_ARRAY:
            {
                if (!inQuotes)
                {
                    arrayIndexDepth--;
                }
                return;
            }
            }
        }