Don't vary token concatenation based on the language options; this

behavior is more likely to be confusing than useful.

llvm-svn: 72499
This commit is contained in:
Eli Friedman 2009-05-27 22:33:06 +00:00
parent 5068f77ac7
commit 98dbc1c79a
1 changed files with 3 additions and 6 deletions

View File

@ -192,8 +192,7 @@ bool TokenConcatenation::AvoidConcat(const Token &PrevTok,
return isalnum(FirstChar) || Tok.is(tok::numeric_constant) ||
FirstChar == '+' || FirstChar == '-' || FirstChar == '.';
case tok::period: // ..., .*, .1234
return FirstChar == '.' || isdigit(FirstChar) ||
(FirstChar == '*' && PP.getLangOptions().CPlusPlus);
return FirstChar == '.' || isdigit(FirstChar) || FirstChar == '*';
case tok::amp: // &&
return FirstChar == '&';
case tok::plus: // ++
@ -209,11 +208,9 @@ bool TokenConcatenation::AvoidConcat(const Token &PrevTok,
case tok::pipe: // ||
return FirstChar == '|';
case tok::percent: // %>, %:
return (FirstChar == '>' || FirstChar == ':') &&
PP.getLangOptions().Digraphs;
return FirstChar == '>' || FirstChar == ':';
case tok::colon: // ::, :>
return (FirstChar == ':' && PP.getLangOptions().CPlusPlus) ||
(FirstChar == '>' && PP.getLangOptions().Digraphs);
return FirstChar == ':' ||FirstChar == '>';
case tok::hash: // ##, #@, %:%:
return FirstChar == '#' || FirstChar == '@' || FirstChar == '%';
case tok::arrow: // ->*