MySql.Data.MySqlClient.MySqlTokenizer.ReadQuotedToken C# (CSharp) Method

ReadQuotedToken() private method

Read a single quoted identifier from the stream
private ReadQuotedToken ( char quoteChar ) : void
quoteChar char
return void
        private void ReadQuotedToken(char quoteChar)
        {
            if (quoteChar == '[')
                quoteChar = ']';
            startIndex = pos-1;
            bool escaped = false;

            bool found = false;
            while (pos < sql.Length)
            {
                char c = sql[pos];

                if (c == quoteChar && !escaped)
                {
                    found = true;
                    break;
                }

                if (escaped)
                    escaped = false;
                else if (c == '\\' && BackslashEscapes)
                    escaped = true;
                pos++;
            }
            if (found) pos++;
            Quoted = found;
            stopIndex = pos;
        }