[cfe-dev] clang-format and "ASCII art" formatting

Sebastian Redl sebastian.redl at getdesigned.at
Fri Dec 7 11:32:12 PST 2012


On 07.12.2012, at 20:11, Sean Silva wrote:

>> Regarding this specific example: I think it could be "simple" to just treat
>> the whole line as "unbreakable" whenever there are several "case" on it.
>> 
>> That is, if two 'case' are on the same physical line, just treat this whole
>> line as a black box, and contend yourself with aligning it first non-blank
>> character.
> 
> That seems like it would work well and be a good general policy. There
> are harder examples though like
> <http://clang.llvm.org/doxygen/Lexer_8cpp_source.html#l01013> where
> the source code is actually aligned with contents of nearby comments.

Recognizing and leaving alone "tabular" array initializers would generally be a good thing. These are very common.

Sebastian



More information about the cfe-dev mailing list