diff options
author | Chris Lattner <sabre@nondot.org> | 2008-10-12 03:22:02 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-10-12 03:22:02 +0000 |
commit | fa95a019da00b926d64ff83358ba73bbc6ae1e37 (patch) | |
tree | 7f2abebe71246ec4f3e22cac176ec054b280fe0e /lib/Lex/Lexer.cpp | |
parent | a2c7ad9c7312df162300ba95828ed3b6c3b38131 (diff) |
add a new inKeepCommentMode() accessor to abstract the KeepCommentMode
ivar.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57397 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Lex/Lexer.cpp')
-rw-r--r-- | lib/Lex/Lexer.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/Lex/Lexer.cpp b/lib/Lex/Lexer.cpp index a259b2aacf..23afa323f8 100644 --- a/lib/Lex/Lexer.cpp +++ b/lib/Lex/Lexer.cpp @@ -804,7 +804,7 @@ bool Lexer::SkipBCPLComment(Token &Result, const char *CurPtr) { // Found but did not consume the newline. // If we are returning comments as tokens, return this comment as a token. - if (KeepCommentMode) + if (inKeepCommentMode()) return SaveBCPLComment(Result, CurPtr); // If we are inside a preprocessor directive and we see the end of line, @@ -1015,7 +1015,7 @@ bool Lexer::SkipBlockComment(Token &Result, const char *CurPtr) { } // If we are returning comments as tokens, return this comment as a token. - if (KeepCommentMode) { + if (inKeepCommentMode()) { Result.setKind(tok::comment); FormTokenWithChars(Result, CurPtr); return false; @@ -1263,10 +1263,10 @@ LexNextToken: // If the next token is obviously a // or /* */ comment, skip it efficiently // too (without going through the big switch stmt). - if (CurPtr[0] == '/' && CurPtr[1] == '/' && !KeepCommentMode) { + if (CurPtr[0] == '/' && CurPtr[1] == '/' && !inKeepCommentMode()) { SkipBCPLComment(Result, CurPtr+2); goto SkipIgnoredUnits; - } else if (CurPtr[0] == '/' && CurPtr[1] == '*' && !KeepCommentMode) { + } else if (CurPtr[0] == '/' && CurPtr[1] == '*' && !inKeepCommentMode()) { SkipBlockComment(Result, CurPtr+2); goto SkipIgnoredUnits; } else if (isHorizontalWhitespace(*CurPtr)) { |