Skip trailing space, we never need it. Fixes cling tests.

This commit is contained in:
Axel Naumann 2014-04-17 14:14:00 +02:00 committed by sftnight
parent fd7790dc53
commit d736e5d862

View File

@ -61,12 +61,19 @@ namespace cling {
return;
Token Tok = lookAhead(1);
Token PrevTok = Tok;
while (Tok.isNot(stopAt) && Tok.isNot(tok::eof)){
//MergedTok.setLength(MergedTok.getLength() + Tok.getLength());
m_TokenCache.erase(m_TokenCache.begin() + 1);
PrevTok = Tok;
Tok = lookAhead(1);
}
MergedTok.setKind(tok::raw_ident);
if (PrevTok.is(tok::space)) {
// for "id <space> eof" the merged token should contain "id", not
// "id <space>".
Tok = PrevTok;
}
MergedTok.setLength(Tok.getBufStart() - MergedTok.getBufStart());
}