Typz added a comment.

This cannot be implemented where we currently call breakProtrudingToken(), 
since this function starts by 'creating' the BreakableToken and dealing with 
meany corner cases: so this should be done before in any case.
But the code at the end of breakProtrudingToken() is actually very similar to 
what you propose.

I can refactor the code to have two functions reflowProtrudingToken() and 
getExcessPenalty(), though that will add some significant redundancy: the 
problem is that even if we don't actually reflow, we still need (I think?) to 
handle whitespace replacement and update the state (to set Column, 
Stack.back().LastSpace, and Stack[i].BreakBeforeParameter, and call 
updateNextToken() ...). And therefore getExcessPenalty() should probably not 
just compute the penalty, it should also update the state and handle whitespace 
replacement...


https://reviews.llvm.org/D33589



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

Reply via email to