diff options
author | Daniel Jasper <djasper@google.com> | 2014-01-09 13:56:49 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2014-01-09 13:56:49 +0000 |
commit | dc32c1bf3a7b9b66d6c48039d915c980f478cf2b (patch) | |
tree | 5560ba8bd40da32cc5b56a7eaca42e139bb206ff /clang/lib/Format/TokenAnnotator.cpp | |
parent | 0160347b2210ef3cd9b074cbe1ae9ecc5ed8f3fa (diff) | |
download | bcm5719-llvm-dc32c1bf3a7b9b66d6c48039d915c980f478cf2b.tar.gz bcm5719-llvm-dc32c1bf3a7b9b66d6c48039d915c980f478cf2b.zip |
clang-format: Understand #pragma mark
Before:
#pragma mark Any non - hyphenated or hyphenated string(including parentheses).
After:
#pragma mark Any non-hyphenated or hyphenated string (including parentheses).
llvm-svn: 198870
Diffstat (limited to 'clang/lib/Format/TokenAnnotator.cpp')
-rw-r--r-- | clang/lib/Format/TokenAnnotator.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/clang/lib/Format/TokenAnnotator.cpp b/clang/lib/Format/TokenAnnotator.cpp index 98cc0033429..1268be29b3c 100644 --- a/clang/lib/Format/TokenAnnotator.cpp +++ b/clang/lib/Format/TokenAnnotator.cpp @@ -474,6 +474,18 @@ private: } } + 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) @@ -495,6 +507,9 @@ private: case tok::pp_warning: parseWarningOrError(); break; + case tok::pp_pragma: + parsePragma(); + break; case tok::pp_if: case tok::pp_elif: parseLine(); |