Lines Matching refs:BufferPtr
86 if (BufferPtr == CommentEnd)
89 switch (*BufferPtr) {
94 const char *NewBufferPtr = BufferPtr;
107 BufferPtr = NewBufferPtr + 1;
111 BufferPtr++;
118 const char *findNewline(const char *BufferPtr, const char *BufferEnd) {
119 for ( ; BufferPtr != BufferEnd; ++BufferPtr) {
120 if (isVerticalWhitespace(*BufferPtr))
121 return BufferPtr;
126 const char *skipNewline(const char *BufferPtr, const char *BufferEnd) {
127 if (BufferPtr == BufferEnd)
128 return BufferPtr;
130 if (*BufferPtr == '\n')
131 BufferPtr++;
133 assert(*BufferPtr == '\r');
134 BufferPtr++;
135 if (BufferPtr != BufferEnd && *BufferPtr == '\n')
136 BufferPtr++;
138 return BufferPtr;
141 const char *skipNamedCharacterReference(const char *BufferPtr,
143 for ( ; BufferPtr != BufferEnd; ++BufferPtr) {
144 if (!isHTMLNamedCharacterReferenceCharacter(*BufferPtr))
145 return BufferPtr;
150 const char *skipDecimalCharacterReference(const char *BufferPtr,
152 for ( ; BufferPtr != BufferEnd; ++BufferPtr) {
153 if (!isHTMLDecimalCharacterReferenceCharacter(*BufferPtr))
154 return BufferPtr;
159 const char *skipHexCharacterReference(const char *BufferPtr,
161 for ( ; BufferPtr != BufferEnd; ++BufferPtr) {
162 if (!isHTMLHexCharacterReferenceCharacter(*BufferPtr))
163 return BufferPtr;
176 const char *skipHTMLIdentifier(const char *BufferPtr, const char *BufferEnd) {
177 for ( ; BufferPtr != BufferEnd; ++BufferPtr) {
178 if (!isHTMLIdentifierCharacter(*BufferPtr))
179 return BufferPtr;
188 const char *skipHTMLQuotedString(const char *BufferPtr, const char *BufferEnd)
190 const char Quote = *BufferPtr;
193 BufferPtr++;
194 for ( ; BufferPtr != BufferEnd; ++BufferPtr) {
195 const char C = *BufferPtr;
196 if (C == Quote && BufferPtr[-1] != '\\')
197 return BufferPtr;
202 const char *skipWhitespace(const char *BufferPtr, const char *BufferEnd) {
203 for ( ; BufferPtr != BufferEnd; ++BufferPtr) {
204 if (!isWhitespace(*BufferPtr))
205 return BufferPtr;
210 bool isWhitespace(const char *BufferPtr, const char *BufferEnd) {
211 return skipWhitespace(BufferPtr, BufferEnd) == BufferEnd;
222 const char *skipCommandName(const char *BufferPtr, const char *BufferEnd) {
223 for ( ; BufferPtr != BufferEnd; ++BufferPtr) {
224 if (!isCommandNameCharacter(*BufferPtr))
225 return BufferPtr;
232 const char *findBCPLCommentEnd(const char *BufferPtr, const char *BufferEnd) {
233 const char *CurPtr = BufferPtr;
246 (EscapePtr - 2 >= BufferPtr && EscapePtr[0] == '/' &&
258 const char *findCCommentEnd(const char *BufferPtr, const char *BufferEnd) {
259 for ( ; BufferPtr != BufferEnd; ++BufferPtr) {
260 if (*BufferPtr == '*') {
261 assert(BufferPtr + 1 != BufferEnd);
262 if (*(BufferPtr + 1) == '/')
263 return BufferPtr;
297 const char *TokenPtr = BufferPtr;
327 StringRef UnescapedText(BufferPtr + 1, TokenPtr - (BufferPtr + 1));
340 unsigned Length = TokenPtr - (BufferPtr + 1);
352 const StringRef CommandName(BufferPtr + 1, Length);
371 setupAndLexVerbatimBlock(T, TokenPtr, *BufferPtr, Info);
442 if (BufferPtr != CommentEnd &&
443 isVerticalWhitespace(*BufferPtr)) {
444 BufferPtr = skipNewline(BufferPtr, CommentEnd);
454 assert(BufferPtr < CommentEnd);
460 const char *Newline = findNewline(BufferPtr, CommentEnd);
461 StringRef Line(BufferPtr, Newline - BufferPtr);
473 const char *End = BufferPtr + VerbatimBlockEndCommandName.size();
474 StringRef Name(BufferPtr + 1, End - (BufferPtr + 1));
481 TextEnd = BufferPtr + Pos;
484 if (isWhitespace(BufferPtr, TextEnd)) {
485 BufferPtr = TextEnd;
490 StringRef Text(BufferPtr, TextEnd - BufferPtr);
519 const char *Newline = findNewline(BufferPtr, CommentEnd);
520 const StringRef Text(BufferPtr, Newline - BufferPtr);
528 const char *TokenPtr = BufferPtr;
591 assert(BufferPtr[0] == '<' &&
592 isHTMLIdentifierStartingCharacter(BufferPtr[1]));
593 const char *TagNameEnd = skipHTMLIdentifier(BufferPtr + 2, CommentEnd);
594 StringRef Name(BufferPtr + 1, TagNameEnd - (BufferPtr + 1));
603 BufferPtr = skipWhitespace(BufferPtr, CommentEnd);
605 const char C = *BufferPtr;
606 if (BufferPtr != CommentEnd &&
614 const char *TokenPtr = BufferPtr;
618 StringRef Ident(BufferPtr, TokenPtr - BufferPtr);
659 BufferPtr = skipWhitespace(BufferPtr, CommentEnd);
660 if (BufferPtr == CommentEnd) {
665 C = *BufferPtr;
674 assert(BufferPtr[0] == '<' && BufferPtr[1] == '/');
676 const char *TagNameBegin = skipWhitespace(BufferPtr + 2, CommentEnd);
689 if (BufferPtr != CommentEnd && *BufferPtr == '>')
694 assert(BufferPtr != CommentEnd && *BufferPtr == '>');
696 formTokenWithChars(T, BufferPtr + 1, tok::html_greater);
706 FileLoc(FileLoc), BufferPtr(BufferStart),
714 if (BufferPtr == BufferEnd) {
715 formTokenWithChars(T, BufferPtr, tok::eof);
719 assert(*BufferPtr == '/');
720 BufferPtr++; // Skip first slash.
721 switch(*BufferPtr) {
723 BufferPtr++; // Skip second slash.
725 if (BufferPtr != BufferEnd) {
730 const char C = *BufferPtr;
732 BufferPtr++;
738 if (BufferPtr != BufferEnd && *BufferPtr == '<')
739 BufferPtr++;
744 CommentEnd = findBCPLCommentEnd(BufferPtr, BufferEnd);
748 BufferPtr++; // Skip star.
751 const char C = *BufferPtr;
752 if ((C == '*' && *(BufferPtr + 1) != '/') || C == '!')
753 BufferPtr++;
756 if (BufferPtr != BufferEnd && *BufferPtr == '<')
757 BufferPtr++;
761 CommentEnd = findCCommentEnd(BufferPtr, BufferEnd);
771 const char *EndWhitespace = BufferPtr;
787 if (BufferPtr != CommentEnd) {
793 assert(BufferPtr[0] == '*' && BufferPtr[1] == '/');
794 BufferPtr += 2;
795 assert(BufferPtr <= BufferEnd);
799 formTokenWithChars(T, BufferPtr, tok::newline);