예제 #1
0
파일: XmlParser.cs 프로젝트: jdauie/snail
        private static unsafe char* HandleExclamationPoint(char* pText, char* pStart, char* pEnd, long depth, TokenList tokens)
        {
            char* p = pStart + 2;

            if (p[0] == '-' && p[1] == '-')
            {
                p = FindEndComment(p + 2, pEnd);
                tokens.AddRegion(pStart - pText, TokenType.Comment, p - pStart + 1, depth);
            }
            else if (p[0] == '[' && p[1] == 'C' && p[2] == 'D' && p[3] == 'A' && p[4] == 'T' && p[5] == 'A' && p[6] == '[')
            {
                p = FindEndCDATA(p + 7, pEnd);
                tokens.AddRegion(pStart - pText, TokenType.CDATA, p - pStart + 1, depth);
            }
            else
            {
                while (p != pEnd && *p != '>') ++p;
                tokens.AddDecl(pStart - pText, p - pStart + 1, depth);
            }

            return p;
        }