Lines Matching refs:BufferPtr
86 if (BufferPtr == CommentEnd) in skipLineStartingDecorations()
89 switch (*BufferPtr) { in skipLineStartingDecorations()
94 const char *NewBufferPtr = BufferPtr; in skipLineStartingDecorations()
107 BufferPtr = NewBufferPtr + 1; in skipLineStartingDecorations()
111 BufferPtr++; in skipLineStartingDecorations()
118 const char *findNewline(const char *BufferPtr, const char *BufferEnd) { in findNewline() argument
119 for ( ; BufferPtr != BufferEnd; ++BufferPtr) { in findNewline()
120 if (isVerticalWhitespace(*BufferPtr)) in findNewline()
121 return BufferPtr; in findNewline()
126 const char *skipNewline(const char *BufferPtr, const char *BufferEnd) { in skipNewline() argument
127 if (BufferPtr == BufferEnd) in skipNewline()
128 return BufferPtr; in skipNewline()
130 if (*BufferPtr == '\n') in skipNewline()
131 BufferPtr++; in skipNewline()
133 assert(*BufferPtr == '\r'); in skipNewline()
134 BufferPtr++; in skipNewline()
135 if (BufferPtr != BufferEnd && *BufferPtr == '\n') in skipNewline()
136 BufferPtr++; in skipNewline()
138 return BufferPtr; in skipNewline()
141 const char *skipNamedCharacterReference(const char *BufferPtr, in skipNamedCharacterReference() argument
143 for ( ; BufferPtr != BufferEnd; ++BufferPtr) { in skipNamedCharacterReference()
144 if (!isHTMLNamedCharacterReferenceCharacter(*BufferPtr)) in skipNamedCharacterReference()
145 return BufferPtr; in skipNamedCharacterReference()
150 const char *skipDecimalCharacterReference(const char *BufferPtr, in skipDecimalCharacterReference() argument
152 for ( ; BufferPtr != BufferEnd; ++BufferPtr) { in skipDecimalCharacterReference()
153 if (!isHTMLDecimalCharacterReferenceCharacter(*BufferPtr)) in skipDecimalCharacterReference()
154 return BufferPtr; in skipDecimalCharacterReference()
159 const char *skipHexCharacterReference(const char *BufferPtr, in skipHexCharacterReference() argument
161 for ( ; BufferPtr != BufferEnd; ++BufferPtr) { in skipHexCharacterReference()
162 if (!isHTMLHexCharacterReferenceCharacter(*BufferPtr)) in skipHexCharacterReference()
163 return BufferPtr; in skipHexCharacterReference()
176 const char *skipHTMLIdentifier(const char *BufferPtr, const char *BufferEnd) { in skipHTMLIdentifier() argument
177 for ( ; BufferPtr != BufferEnd; ++BufferPtr) { in skipHTMLIdentifier()
178 if (!isHTMLIdentifierCharacter(*BufferPtr)) in skipHTMLIdentifier()
179 return BufferPtr; in skipHTMLIdentifier()
188 const char *skipHTMLQuotedString(const char *BufferPtr, const char *BufferEnd) in skipHTMLQuotedString() argument
190 const char Quote = *BufferPtr; in skipHTMLQuotedString()
193 BufferPtr++; in skipHTMLQuotedString()
194 for ( ; BufferPtr != BufferEnd; ++BufferPtr) { in skipHTMLQuotedString()
195 const char C = *BufferPtr; in skipHTMLQuotedString()
196 if (C == Quote && BufferPtr[-1] != '\\') in skipHTMLQuotedString()
197 return BufferPtr; in skipHTMLQuotedString()
202 const char *skipWhitespace(const char *BufferPtr, const char *BufferEnd) { in skipWhitespace() argument
203 for ( ; BufferPtr != BufferEnd; ++BufferPtr) { in skipWhitespace()
204 if (!isWhitespace(*BufferPtr)) in skipWhitespace()
205 return BufferPtr; in skipWhitespace()
210 bool isWhitespace(const char *BufferPtr, const char *BufferEnd) { in isWhitespace() argument
211 return skipWhitespace(BufferPtr, BufferEnd) == BufferEnd; in isWhitespace()
222 const char *skipCommandName(const char *BufferPtr, const char *BufferEnd) { in skipCommandName() argument
223 for ( ; BufferPtr != BufferEnd; ++BufferPtr) { in skipCommandName()
224 if (!isCommandNameCharacter(*BufferPtr)) in skipCommandName()
225 return BufferPtr; in skipCommandName()
232 const char *findBCPLCommentEnd(const char *BufferPtr, const char *BufferEnd) { in findBCPLCommentEnd() argument
233 const char *CurPtr = BufferPtr; in findBCPLCommentEnd()
246 (EscapePtr - 2 >= BufferPtr && EscapePtr[0] == '/' && in findBCPLCommentEnd()
258 const char *findCCommentEnd(const char *BufferPtr, const char *BufferEnd) { in findCCommentEnd() argument
259 for ( ; BufferPtr != BufferEnd; ++BufferPtr) { in findCCommentEnd()
260 if (*BufferPtr == '*') { in findCCommentEnd()
261 assert(BufferPtr + 1 != BufferEnd); in findCCommentEnd()
262 if (*(BufferPtr + 1) == '/') in findCCommentEnd()
263 return BufferPtr; in findCCommentEnd()
273 const unsigned TokLen = TokEnd - BufferPtr; in formTokenWithChars()
274 Result.setLocation(getSourceLocation(BufferPtr)); in formTokenWithChars()
281 BufferPtr = TokEnd; in formTokenWithChars()
310 const char *TokenPtr = BufferPtr; in lexCommentText()
340 StringRef UnescapedText(BufferPtr + 1, TokenPtr - (BufferPtr + 1)); in lexCommentText()
353 unsigned Length = TokenPtr - (BufferPtr + 1); in lexCommentText()
365 StringRef CommandName(BufferPtr + 1, Length); in lexCommentText()
371 SourceLocation Loc = getSourceLocation(BufferPtr); in lexCommentText()
385 setupAndLexVerbatimBlock(T, TokenPtr, *BufferPtr, Info); in lexCommentText()
456 if (BufferPtr != CommentEnd && in setupAndLexVerbatimBlock()
457 isVerticalWhitespace(*BufferPtr)) { in setupAndLexVerbatimBlock()
458 BufferPtr = skipNewline(BufferPtr, CommentEnd); in setupAndLexVerbatimBlock()
468 assert(BufferPtr < CommentEnd); in lexVerbatimBlockFirstLine()
474 const char *Newline = findNewline(BufferPtr, CommentEnd); in lexVerbatimBlockFirstLine()
475 StringRef Line(BufferPtr, Newline - BufferPtr); in lexVerbatimBlockFirstLine()
487 const char *End = BufferPtr + VerbatimBlockEndCommandName.size(); in lexVerbatimBlockFirstLine()
488 StringRef Name(BufferPtr + 1, End - (BufferPtr + 1)); in lexVerbatimBlockFirstLine()
495 TextEnd = BufferPtr + Pos; in lexVerbatimBlockFirstLine()
498 if (isWhitespace(BufferPtr, TextEnd)) { in lexVerbatimBlockFirstLine()
499 BufferPtr = TextEnd; in lexVerbatimBlockFirstLine()
504 StringRef Text(BufferPtr, TextEnd - BufferPtr); in lexVerbatimBlockFirstLine()
517 if (BufferPtr == CommentEnd) { in lexVerbatimBlockBody()
518 formTokenWithChars(T, BufferPtr, tok::verbatim_block_line); in lexVerbatimBlockBody()
539 const char *Newline = findNewline(BufferPtr, CommentEnd); in lexVerbatimLineText()
540 StringRef Text(BufferPtr, Newline - BufferPtr); in lexVerbatimLineText()
548 const char *TokenPtr = BufferPtr; in lexHTMLCharacterReference()
611 assert(BufferPtr[0] == '<' && in setupAndLexHTMLStartTag()
612 isHTMLIdentifierStartingCharacter(BufferPtr[1])); in setupAndLexHTMLStartTag()
613 const char *TagNameEnd = skipHTMLIdentifier(BufferPtr + 2, CommentEnd); in setupAndLexHTMLStartTag()
614 StringRef Name(BufferPtr + 1, TagNameEnd - (BufferPtr + 1)); in setupAndLexHTMLStartTag()
623 BufferPtr = skipWhitespace(BufferPtr, CommentEnd); in setupAndLexHTMLStartTag()
625 const char C = *BufferPtr; in setupAndLexHTMLStartTag()
626 if (BufferPtr != CommentEnd && in setupAndLexHTMLStartTag()
634 const char *TokenPtr = BufferPtr; in lexHTMLStartTag()
638 StringRef Ident(BufferPtr, TokenPtr - BufferPtr); in lexHTMLStartTag()
679 BufferPtr = skipWhitespace(BufferPtr, CommentEnd); in lexHTMLStartTag()
680 if (BufferPtr == CommentEnd) { in lexHTMLStartTag()
685 C = *BufferPtr; in lexHTMLStartTag()
694 assert(BufferPtr[0] == '<' && BufferPtr[1] == '/'); in setupAndLexHTMLEndTag()
696 const char *TagNameBegin = skipWhitespace(BufferPtr + 2, CommentEnd); in setupAndLexHTMLEndTag()
709 if (BufferPtr != CommentEnd && *BufferPtr == '>') in setupAndLexHTMLEndTag()
714 assert(BufferPtr != CommentEnd && *BufferPtr == '>'); in lexHTMLEndTag()
716 formTokenWithChars(T, BufferPtr + 1, tok::html_greater); in lexHTMLEndTag()
726 FileLoc(FileLoc), BufferPtr(BufferStart), in Lexer()
734 if (BufferPtr == BufferEnd) { in lex()
735 formTokenWithChars(T, BufferPtr, tok::eof); in lex()
739 assert(*BufferPtr == '/'); in lex()
740 BufferPtr++; // Skip first slash. in lex()
741 switch(*BufferPtr) { in lex()
743 BufferPtr++; // Skip second slash. in lex()
745 if (BufferPtr != BufferEnd) { in lex()
750 const char C = *BufferPtr; in lex()
752 BufferPtr++; in lex()
758 if (BufferPtr != BufferEnd && *BufferPtr == '<') in lex()
759 BufferPtr++; in lex()
764 CommentEnd = findBCPLCommentEnd(BufferPtr, BufferEnd); in lex()
768 BufferPtr++; // Skip star. in lex()
771 const char C = *BufferPtr; in lex()
772 if ((C == '*' && *(BufferPtr + 1) != '/') || C == '!') in lex()
773 BufferPtr++; in lex()
776 if (BufferPtr != BufferEnd && *BufferPtr == '<') in lex()
777 BufferPtr++; in lex()
781 CommentEnd = findCCommentEnd(BufferPtr, BufferEnd); in lex()
791 const char *EndWhitespace = BufferPtr; in lex()
807 if (BufferPtr != CommentEnd) { in lex()
813 assert(BufferPtr[0] == '*' && BufferPtr[1] == '/'); in lex()
814 BufferPtr += 2; in lex()
815 assert(BufferPtr <= BufferEnd); in lex()
819 formTokenWithChars(T, BufferPtr, tok::newline); in lex()