From: Robert M. <mc...@cf...> - 2003-04-10 21:04:46
|
Here is my ideas (and what I have implemented): By default the trace string is on the same line as the { If the --indent option is given then there are three cases: a) If there is a trace string then the same indentation is reused. b) If there is code on the same line then the trace string is added on the same line (as before). c) If there is no trace string then a new line is added and the current indentation is inserted. Here are examples of the three cases. If the input is this: int X::caseA(float x) { /* %TRACE% */ FUNC_TRACE("X::caseA(float x)"); /* %TRACE% */ // } int X::caseB(float x) {} int X::caseC(float x) { // } Then the output of B<traceString --indent ...> is: int X::caseA(float x) { /* %TRACE% */ FUNC_TRACE("X::caseA(float x)"); /* %TRACE% */ // } int X::caseB(float x) { /* %TRACE% */ FUNC_TRACE("X::caseB(float x)"); /* %TRACE% */} int X::caseC(float x) { /* %TRACE% */ FUNC_TRACE("X::caseC(float x)"); /* %TRACE% */ // } R. |