[cfe-commits] r112391 - in /cfe/trunk: include/clang/Lex/Preprocessor.h lib/Lex/PPMacroExpansion.cpp lib/Lex/Pragma.cpp test/Preprocessor/pragma_microsoft.c

John McCall rjmccall at apple.com
Sat Aug 28 18:10:56 PDT 2010


On Aug 28, 2010, at 3:46 PM, Eli Friedman wrote:

> On Sat, Aug 28, 2010 at 3:34 PM, John McCall <rjmccall at apple.com> wrote:
>> +  // Get the tokens enclosed within the __pragma().
>> +  llvm::SmallVector<Token, 32> PragmaToks;
>> +  int NumParens = 0;
>> +  Lex(Tok);
>> +  while (Tok.isNot(tok::eof)) {
>> +    if (Tok.is(tok::l_paren))
>> +      NumParens++;
>> +    else if (Tok.is(tok::r_paren) && NumParens-- == 0)
>> +      break;
>> +    PragmaToks.push_back(Tok);
>> +    Lex(Tok);
>> +  }
> 
> Should we give an error for an unclosed __pragma?

Good point.  r112392.

John.



More information about the cfe-commits mailing list