KeepCommentMode = Mode;
}
+ /// inKeepCommentMode - Return true if the lexer should return comments as
+ /// tokens.
+ bool inKeepCommentMode() const {
+ return KeepCommentMode;
+ }
+
+
/// ReadToEndOfLine - Read the rest of the current preprocessor line as an
/// uninterpreted string. This switches the lexer out of directive mode.
std::string ReadToEndOfLine();
// 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,
}
// 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;
// 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)) {