Return whether there was a (non-punct) token between now and next (ROOT-8529).

This commit is contained in:
Axel Naumann
2017-01-12 17:00:40 +01:00
committed by sftnight
parent bb2de6d3b0
commit cfbf9ee8c8
2 changed files with 6 additions and 4 deletions

View File

@ -135,8 +135,9 @@ namespace cling {
}
}
void MetaLexer::LexPunctuatorAndAdvance(const char*& curPos, Token& Tok) {
bool MetaLexer::LexPunctuatorAndAdvance(const char*& curPos, Token& Tok) {
Tok.startToken(curPos);
bool nextWasPunct = true;
while (true) {
if(*curPos == '\\')
@ -149,12 +150,13 @@ namespace cling {
Tok.setBufStart(curPos);
Tok.setKind(tok::eof);
Tok.setLength(0);
return;
return nextWasPunct;
}
}
MetaLexer::LexPunctuator(curPos++, Tok);
if (Tok.isNot(tok::unknown))
return;
return nextWasPunct;
nextWasPunct = false;
}
}