aboutsummaryrefslogtreecommitdiff
path: root/lib/Lex/PTHLexer.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2008-11-20 01:16:50 +0000
committerTed Kremenek <kremenek@apple.com>2008-11-20 01:16:50 +0000
commit4d35da2e41941965bbee8ed7e8c30e7c21000d71 (patch)
treec3ebf9a1cc97cfce3bf85f5157b73ee74f154193 /lib/Lex/PTHLexer.cpp
parent855ed158eecfd2a99a47f72cc216bf7b41e2c94f (diff)
Add (untested) implementation of PTHLexer::isNextPPTokenLParen() and PTHLexer::DiscardToEndOfLine().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59687 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Lex/PTHLexer.cpp')
-rw-r--r--lib/Lex/PTHLexer.cpp18
1 files changed, 14 insertions, 4 deletions
diff --git a/lib/Lex/PTHLexer.cpp b/lib/Lex/PTHLexer.cpp
index e9d6d4794f..5adcd9f6a1 100644
--- a/lib/Lex/PTHLexer.cpp
+++ b/lib/Lex/PTHLexer.cpp
@@ -80,11 +80,21 @@ void PTHLexer::setEOF(Token& Tok) {
void PTHLexer::DiscardToEndOfLine() {
assert(ParsingPreprocessorDirective && ParsingFilename == false &&
"Must be in a preprocessing directive!");
- assert (0 && "Not implemented.");
+
+ // Already at end-of-file?
+ if (CurToken == NumTokens)
+ return;
+
+ // Find the first token that is not the start of the *current* line.
+ for ( ++CurToken; CurToken != NumTokens ; ++CurToken )
+ if (Tokens[CurToken].isAtStartOfLine())
+ return;
}
-unsigned PTHLexer::isNextPPTokenLParen() {
- assert (0 && "Not implemented.");
- return 0;
+unsigned PTHLexer::isNextPPTokenLParen() {
+ if (CurToken == NumTokens)
+ return 2;
+
+ return Tokens[CurToken].is(tok::l_paren);
}