summaryrefslogtreecommitdiffstats
path: root/clang/lib/Format/UnwrappedLineParser.h
diff options
context:
space:
mode:
authorManuel Klimek <klimek@google.com>2013-01-04 23:34:14 +0000
committerManuel Klimek <klimek@google.com>2013-01-04 23:34:14 +0000
commit1abf789c7ad1e4d3abc5108d9d32baf34f24a51f (patch)
treeeaf0d1295b121e7eb5127facc2e51d5d7ad0c473 /clang/lib/Format/UnwrappedLineParser.h
parenta82e9265d8230b0908071c777e16dcebbf2679a9 (diff)
downloadbcm5719-llvm-1abf789c7ad1e4d3abc5108d9d32baf34f24a51f.tar.gz
bcm5719-llvm-1abf789c7ad1e4d3abc5108d9d32baf34f24a51f.zip
Various fixes to clang-format's macro handling.
Some of this is still pretty rough (note the load of FIXMEs), but it is strictly an improvement and fixes various bugs that were related to macro processing but are also imporant in non-macro use cases. Specific fixes: - correctly puts espaced newlines at the end of the line - fixes counting of white space before a token when escaped newlines are present - fixes parsing of "trailing" tokens when eof() is hit - puts macro parsing orthogonal to parsing other structure - general support for parsing of macro definitions Due to the fix to format trailing tokens, this change also includes a bunch of fixes to the c-index tests. llvm-svn: 171556
Diffstat (limited to 'clang/lib/Format/UnwrappedLineParser.h')
-rw-r--r--clang/lib/Format/UnwrappedLineParser.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/clang/lib/Format/UnwrappedLineParser.h b/clang/lib/Format/UnwrappedLineParser.h
index 9ed796d45b4..69ac7683254 100644
--- a/clang/lib/Format/UnwrappedLineParser.h
+++ b/clang/lib/Format/UnwrappedLineParser.h
@@ -101,9 +101,12 @@ public:
bool parse();
private:
+ bool parseFile();
bool parseLevel();
bool parseBlock(unsigned AddLevels = 1);
void parsePPDirective();
+ void parsePPDefine();
+ void parsePPUnknown();
void parseComments();
void parseStatement();
void parseParens();
@@ -119,12 +122,13 @@ private:
void addUnwrappedLine();
bool eof() const;
void nextToken();
+ void readToken();
UnwrappedLine Line;
FormatToken FormatTok;
const FormatStyle &Style;
- FormatTokenSource &Tokens;
+ FormatTokenSource *Tokens;
UnwrappedLineConsumer &Callback;
};
OpenPOWER on IntegriCloud