Before:
#pragma mark Any non - hyphenated or hyphenated string(including parentheses).
After:
#pragma mark Any non-hyphenated or hyphenated string (including parentheses).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198870
91177308-0d34-0410-b5e6-
96231b3b80d8
}
}
+ void parsePragma() {
+ next(); // Consume "pragma".
+ if (CurrentToken && CurrentToken->TokenText == "mark") {
+ next(); // Consume "mark".
+ next(); // Consume first token (so we fix leading whitespace).
+ while (CurrentToken != NULL) {
+ CurrentToken->Type = TT_ImplicitStringLiteral;
+ next();
+ }
+ }
+ }
+
void parsePreprocessorDirective() {
next();
if (CurrentToken == NULL)
case tok::pp_warning:
parseWarningOrError();
break;
+ case tok::pp_pragma:
+ parsePragma();
+ break;
case tok::pp_if:
case tok::pp_elif:
parseLine();
TEST_F(FormatTest, UnderstandsPragmas) {
verifyFormat("#pragma omp reduction(| : var)");
verifyFormat("#pragma omp reduction(+ : var)");
+
+ EXPECT_EQ("#pragma mark Any non-hyphenated or hyphenated string "
+ "(including parentheses).",
+ format("#pragma mark Any non-hyphenated or hyphenated string "
+ "(including parentheses)."));
}
#define EXPECT_ALL_STYLES_EQUAL(Styles) \