| 7 | namespace das { |
| 8 | |
| 9 | string human_readable_formatting ( const string & str ) { |
| 10 | string result; |
| 11 | string tab; |
| 12 | auto it = str.begin(); |
| 13 | auto tail = str.end(); |
| 14 | while ( it != tail ) { |
| 15 | while ( it!=tail && *it==' ') { |
| 16 | it ++; |
| 17 | } |
| 18 | while ( it!=tail && *it!='\n' ) { |
| 19 | auto Ch = *it; |
| 20 | result += Ch; |
| 21 | if ( Ch=='[' || Ch=='(' || Ch=='{' ) tab += " "; |
| 22 | else if ( Ch==']' || Ch==')' || Ch=='}' ) { |
| 23 | if ( tab.size()>=2 ) tab.resize(tab.size()-2); // note: we don't track mismatch |
| 24 | } |
| 25 | it ++; |
| 26 | } |
| 27 | if ( it == tail ) break; |
| 28 | while ( it!=tail && *it=='\n' ) { |
| 29 | it ++; |
| 30 | } |
| 31 | result += "\n"; |
| 32 | result += tab; |
| 33 | } |
| 34 | return result; |
| 35 | } |
| 36 | |
| 37 | string debug_value ( const void * pX, TypeInfo * info, PrintFlags flags ) { |
| 38 | TextWriter ss; |
no test coverage detected