Commit b8fc996
committed
Fix aggregate_vector_diagnosis description indent handling
Fix a bug in aggregate_vector_diagnosis that breaks Julienne diagnostic string agreggation with .also.
Currently given an incremental diagnosis pattern like this:
```fortran
diag = .true.
diag = .diag. .also. .false. // "whatever"
do i=1,100
diag = .diag. .also. .true.
end do
```
The code in aggregate_vector_diagnosis will prepend 100 `new_line_indent` strings into the diagnosis string (ie 100 blank lines), even though there was only one actual failure.
Fundamentally the problem is that a `new_line_indent` is being prepended each time `aggregate_vector_diagnosis` is called with a failing argument, even if the failing diagnosis was the outcome of a previous call to `aggregate_vector_diagnosis` that already prepended a new line.
The surgical solution in this PR prevents this defect. As a side-benefit it also provides nicer behavior if the client has formatted their own output line and already inserted a line break, eg:
```fortran
diag = test_diagnosis_t(.false.,new_line('') // " I formatted this line myself!")
```1 parent a1404e7 commit b8fc996
1 file changed
Lines changed: 12 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
98 | | - | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
99 | 104 | | |
100 | 105 | | |
101 | 106 | | |
| |||
119 | 124 | | |
120 | 125 | | |
121 | 126 | | |
122 | | - | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
123 | 133 | | |
124 | 134 | | |
125 | 135 | | |
| |||
0 commit comments