(StringRef::const_iterator I = S.begin(),
E= S.end(); I !=
E; ++I) {
31llvm::BumpPtrAllocator &Allocator;
35 boolNoMoreInterestingTokens;
42 const char*BufferStart;
43 const char*BufferEnd;
44 const char*BufferPtr;
53 returnPos.CurToken >= Toks.size();
59 const Token&Tok = Toks[Pos.CurToken];
61Pos.BufferStart = Tok.
getText().begin();
62Pos.BufferEnd = Tok.
getText().end();
63Pos.BufferPtr = Pos.BufferStart;
68 const unsignedCharNo = Pos.BufferPtr - Pos.BufferStart;
69 returnPos.BufferStartLoc.getLocWithOffset(CharNo);
74assert(Pos.BufferPtr != Pos.BufferEnd);
75 return*Pos.BufferPtr;
80assert(Pos.BufferPtr != Pos.BufferEnd);
82 if(Pos.BufferPtr == Pos.BufferEnd) {
84 if(isEnd() && !addToken())
94 unsignedBracketCount = 0;
96 const char C= peek();
97WordText.push_back(
C);
121 if(NoMoreInterestingTokens)
130NoMoreInterestingTokens =
true;
135NoMoreInterestingTokens =
true;
139Toks.push_back(
P.Tok);
141 if(Toks.size() == 1)
146 voidconsumeWhitespace() {
157 const char*TokBegin,
162 Result.setLength(TokLength);
164 Result.TextPtr =
"<UNSET>";
172Allocator(Allocator),
P(
P), NoMoreInterestingTokens(
false) {
184Position SavedPos = Pos;
189 const char*WordBegin = Pos.BufferPtr;
193 const char C= peek();
198 if(!lexTemplate(WordText))
201WordText.push_back(
C);
210 const unsignedLength = WordText.size();
216 char*TextPtr = Allocator.Allocate<
char>(Length + 1);
218 memcpy(TextPtr, WordText.c_str(), Length + 1);
219StringRef
Text= StringRef(TextPtr, Length);
221formTokenWithChars(Tok,
Loc, WordBegin, Length,
Text);
237llvm::StringRef LineStart(Pos.BufferPtr - Offset - 3, 4);
238 returnLineStart.starts_with(
"\\par") || LineStart.starts_with(
"@par");
246Position SavedPos = Pos;
250 const char*WordBegin = Pos.BufferPtr;
259WordText.push_back(peek());
260 if(Pos.BufferPtr + 1 == Pos.BufferEnd) {
267 unsignedLength = WordText.size();
273 char*TextPtr = Allocator.Allocate<
char>(Length + 1);
275 memcpy(TextPtr, WordText.c_str(), Length + 1);
276StringRef
Text= StringRef(TextPtr, Length);
278formTokenWithChars(Tok,
Loc, WordBegin, Length,
Text);
287Position SavedPos = Pos;
291 const char*WordBegin = Pos.BufferPtr;
294 const char C= peek();
296WordText.push_back(
C);
301 const unsignedLength = WordText.size();
307 char*TextPtr = Allocator.Allocate<
char>(Length + 1);
309 memcpy(TextPtr, WordText.c_str(), Length + 1);
310StringRef
Text= StringRef(TextPtr, Length);
312formTokenWithChars(Tok,
Loc, WordBegin, Length,
Text);
320Position SavedPos = Pos;
324 const char*WordBegin = Pos.BufferPtr;
328 const char C= peek();
329 if(
C== OpenDelim) {
330WordText.push_back(
C);
336 while(!Error && !isEnd()) {
338WordText.push_back(
C);
340 if(
C== CloseDelim)
343 if(!Error &&
C!= CloseDelim)
351 const unsignedLength = WordText.size();
352 char*TextPtr = Allocator.Allocate<
char>(Length + 1);
354 memcpy(TextPtr, WordText.c_str(), Length + 1);
355StringRef
Text= StringRef(TextPtr, Length);
357formTokenWithChars(Tok,
Loc, WordBegin,
358Pos.BufferPtr - WordBegin,
Text);
367 boolHavePartialTok =
false;
369 if(Pos.BufferPtr != Pos.BufferStart) {
370formTokenWithChars(PartialTok, getSourceLocation(),
371Pos.BufferPtr, Pos.BufferEnd - Pos.BufferPtr,
372StringRef(Pos.BufferPtr,
373Pos.BufferEnd - Pos.BufferPtr));
374HavePartialTok =
true;
379Pos.CurToken = Toks.size();
382 P.putBack(PartialTok);
386Parser::Parser(
Lexer&L,
Sema&S, llvm::BumpPtrAllocator &Allocator,
389L(L), S(S), Allocator(Allocator), SourceMgr(SourceMgr), Diags(Diags),
405 if(Retokenizer.
lexWord(Arg))
415 if(Retokenizer.
lexWord(Arg))
426 unsignedParsedArgs = 0;
428 while(ParsedArgs < NumArgs && Retokenizer.
lexWord(Arg)) {
442 unsignedParsedArgs = 0;
445 while(ParsedArgs < NumArgs && Retokenizer.
lexType(Arg)) {
460 unsignedParsedArgs = 0;
463 while(ParsedArgs < NumArgs && Retokenizer.
lexParHeading(Arg)) {
499 if(isTokBlockCommand()) {
515 if(PC || TPC || Info->
NumArgs> 0) {
538 boolEmptyParagraph =
false;
539 if(isTokBlockCommand())
540EmptyParagraph =
true;
544EmptyParagraph = isTokBlockCommand();
555Paragraph = cast<ParagraphComment>(
Block);
574 const TokenCommandTok = Tok;
585 if(Args.size() < Info->
NumArgs) {
587diag::warn_doc_inline_command_not_enough_arguments)
620diag::warn_doc_html_start_tag_expected_quoted_string)
632Equals.getLocation(),
657diag::warn_doc_html_start_tag_expected_ident_or_greater);
676 boolStartLineInvalid;
684 if(StartLineInvalid || EndLineInvalid || StartLine == EndLine)
686diag::warn_doc_html_start_tag_expected_ident_or_greater)
690diag::warn_doc_html_start_tag_expected_ident_or_greater);
691Diag(HST->
getLocation(), diag::note_doc_html_tag_started_here)
701 TokenTokEndTag = Tok;
735 if(Content.size() == 0)
741diag::warn_verbatim_block_end_without_start)
769 TokenWhitespaceTok = Tok;
776putBack(WhitespaceTok);
778 if(Content.size() > 0)
779Content.back()->addTrailingNewline();
807llvm_unreachable(
"should not see this token");
844Lines.push_back(
Line);
913llvm_unreachable(
"should not see this token");
915llvm_unreachable(
"bogus token kind");
Defines the SourceManager interface.
__DEVICE__ void * memcpy(void *__a, const void *__b, size_t __c)
Concrete class used by the front-end to report problems and issues.
Encodes a location in the source.
SourceLocation getLocWithOffset(IntTy Offset) const
Return a source location with the specified offset from this SourceLocation.
This class handles loading and caching of source files into memory.
unsigned getPresumedLineNumber(SourceLocation Loc, bool *Invalid=nullptr) const
A trivial tuple used to represent a source range.
The JSON file list parser is used to communicate input to InstallAPI.
@ Result
The result type of a method or function.
LLVM_READONLY bool isWhitespace(unsigned char c)
Return true if this character is horizontal or vertical ASCII whitespace: ' ', '\t',...
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4