[PATCH] D39806: [clang-format] Support python-style comments in text protos
Daniel Jasper via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Nov 10 00:53:29 PST 2017
djasper accepted this revision.
djasper added inline comments.
This revision is now accepted and ready to land.
================
Comment at: lib/Format/FormatTokenLexer.cpp:344
+ size_t To = Lex->getBuffer().find_first_of('\n', From);
+ if (To == StringRef::npos) To = Lex->getBuffer().size();
+ size_t Len = To - From;
----------------
There should be a linebreak here.
================
Comment at: lib/Format/UnwrappedLineParser.cpp:59
static bool isLineComment(const FormatToken &FormatTok) {
- return FormatTok.is(tok::comment) && FormatTok.TokenText.startswith("//");
+ return FormatTok.is(tok::comment) && (FormatTok.TokenText.startswith("//") ||
+ FormatTok.TokenText.startswith("#"));
----------------
Maybe it's now better to do:
return FormatTok.is(tok::comment) && !FormatTok.TokenText.startsWith("/*");
?
https://reviews.llvm.org/D39806
More information about the cfe-commits
mailing list