[petsc-dev] Style Guide: How to format single-line if/for/while-blocks?

Karl Rupp rupp at mcs.anl.gov
Mon Jan 21 22:31:09 CST 2013


Hi Barry,


>>> Well I think it is insane in 2012 that we all need to stare at the exact same ASCII strings with the exact same placement (each of you thinks is wrong) when we develop shared code, so please teach me how. Can this be done through some bridge that uses the current hg PETSc repository?
>>
>> Yeah, even in *2013* it feels so wrong.
>> I'll see whether I can use Clang to provide this bridge.
>
>     Please do, don't take my previous email attacking the Clang pretty printers too seriously, perhaps your keen eye can figure out how to get them to do everything we'd like to have.

Will do.


>>>     Unfortunately the CPP crap in PETSc messes things up a bit, curse that CPP wish we could eliminate it all. And yes CPP is C preprocessor not C++.
>>
>> Does it? For the formatting itself it's just another layer…
>
>    Yes but it doesn't fit into the C AST.

If I'm not mistaken, one can attach a preprocessor to a compiler object 
and generate some kind of syntax tree as well as a full C AST. This 
allows some additional back-and-forth operations.

Best regards,
Karli




More information about the petsc-dev mailing list