|
![](/i/fill.gif) |
Roland Mas <rol### [at] casimir rezel enst fr> wrote:
: Suppose you have the following lines:
: #if (A > 0)
: union {
: #endif
: sphere { ... }
: #if (A > 0)
: sphere { ... }
: }
: #endif
: How would you indent?
In this case the #if statement doesn't stand for conditional code
execution (like 'if' in C) but for conditional parsing instead (like '#if'
in C) (it's often a bad thing that povray doesn't distinguish between these
two things).
Conditional parsing (or compiling) is always a tricky thing. It makes
the code hard to understand almost always. It's also very hard to indent.
In this case I usually do something like this:
#if(A>0)
union {
#end
sphere { ... }
#if(A>0)
sphere { ... }
}
#end
--
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/
Post a reply to this message
|
![](/i/fill.gif) |