diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2017-04-20 21:20:51 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2017-04-20 21:20:51 +0000 |
commit | 583e75cce441388bc562fa225d23499261a0091e (patch) | |
tree | 5944a7c248d4a8c858db45abc3444eb69270a3c8 /lib/Format | |
parent | 7442d6faa2719e4e7d33a7021c406c5a4facd74d (diff) |
Notes
Diffstat (limited to 'lib/Format')
-rw-r--r-- | lib/Format/FormatTokenLexer.cpp | 3 | ||||
-rw-r--r-- | lib/Format/TokenAnnotator.cpp | 7 |
2 files changed, 7 insertions, 3 deletions
diff --git a/lib/Format/FormatTokenLexer.cpp b/lib/Format/FormatTokenLexer.cpp index 4ee43d6937e00..1acc0c3065126 100644 --- a/lib/Format/FormatTokenLexer.cpp +++ b/lib/Format/FormatTokenLexer.cpp @@ -467,6 +467,9 @@ FormatToken *FormatTokenLexer::getNextToken() { if (pos >= 0 && Text[pos] == '\r') --pos; // See whether there is an odd number of '\' before this. + // FIXME: This is wrong. A '\' followed by a newline is always removed, + // regardless of whether there is another '\' before it. + // FIXME: Newlines can also be escaped by a '?' '?' '/' trigraph. unsigned count = 0; for (; pos >= 0; --pos, ++count) if (Text[pos] != '\\') diff --git a/lib/Format/TokenAnnotator.cpp b/lib/Format/TokenAnnotator.cpp index 004800fc2a4e0..bbc2d1e52b63d 100644 --- a/lib/Format/TokenAnnotator.cpp +++ b/lib/Format/TokenAnnotator.cpp @@ -796,10 +796,11 @@ private: while (CurrentToken) { FormatToken *Tok = CurrentToken; next(); - if (Tok->isOneOf(Keywords.kw___has_include, - Keywords.kw___has_include_next)) { + if (Tok->is(tok::l_paren)) + parseParens(); + else if (Tok->isOneOf(Keywords.kw___has_include, + Keywords.kw___has_include_next)) parseHasInclude(); - } } return Type; } |