strager marked 4 inline comments as done.

================
Comment at: lib/Format/UnwrappedLineParser.cpp:1057-1058
@@ +1056,4 @@
+      while (!eof()) {
+        // FIXME: Once we have an expression parser in the UnwrappedLineParser,
+        // replace this by using parseAssigmentExpression() inside.
+        if (FormatTok->is(tok::l_paren)) {
----------------
strager wrote:
> djasper wrote:
> > I very much doubt that we'll have an Expression parser here anytime soon. 
> > So, I don't think that this FIXME makes much sense. Instead, please provide 
> > a comment on what this is actually doing and in which cases it might fail.
> I copied the comment from elsewhere in the file.
I expanded the comment, including a reference to the other reference to 
`parseAssigmentExpression`.

================
Comment at: lib/Format/UnwrappedLineParser.cpp:1061
@@ +1060,3 @@
+          parseParens();
+        } else if (FormatTok->isOneOf(tok::comma, tok::r_square)) {
+          break;
----------------
strager wrote:
> djasper wrote:
> > I think this list should be extended to figure out certain cases where we 
> > know something is fishy. In particular:
> > * If you find an l_square or less, call into parseSquare and parseAngle 
> > respectively.
> > * If you find an r_brace or semi, something is wrong, break.
> > 
> Will do.
Handling r_brace and semi is a bit weird, since we end up aborting mid-stream 
and what's left becomes unparsable/incomplete by clang-format.

parseAngle doesn't exist, and even if it did, the less-than operator wouldn't 
be handled properly.

I added l_square and l_brace support.


http://reviews.llvm.org/D11693



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to