|
1 | | ---- a/fypp.py |
2 | | -+++ b/fypp.py |
3 | | -@@ -1842,11 +1842,16 @@ class _Renderer: |
4 | | - if self._linenums: |
5 | | - # Last line was folded, but no linenums were generated for |
6 | | - # the continuation lines -> current line position is not |
7 | | - # in sync with the one calculated from the last line number |
8 | | - unsync = ( |
9 | | - len(foldedlines) and len(foldedlines[-1]) > 1 |
| 1 | +--- a/fypp.py 2026-05-14 19:44:34.158817311 -0400 |
| 2 | ++++ b/fypp.py 2026-05-14 19:44:34.188817564 -0400 |
| 3 | +@@ -1848,12 +1848,17 @@ |
10 | 4 | and not self._contlinenums) |
11 | 5 | # Eval directive in source consists of more than one line |
12 | 6 | multiline = span[1] - span[0] > 1 |
13 | 7 | - if unsync or multiline: |
| 8 | +- # For inline eval directives span[0] == span[1] |
| 9 | +- # -> next line is span[0] + 1 and not span[1] as for |
| 10 | +- # line eval directives |
| 11 | +- nextline = max(span[1], span[0] + 1) |
| 12 | +- trailing += self._linenumdir(nextline, fname) |
14 | 13 | + # Always emit a resync marker after a $: call. Without this, |
15 | 14 | + # single-line $: calls that expand to multi-line #if/#endif |
16 | 15 | + # blocks (e.g. GPU_PARALLEL_LOOP) cause the compiler to |
17 | 16 | + # attribute the next Fortran statement to the call-site line |
18 | 17 | + # rather than the following source line, producing off-by-1 |
19 | 18 | + # errors in backtraces and debugger line info. |
20 | | -+ if unsync or multiline or True: |
21 | | - # For inline eval directives span[0] == span[1] |
22 | | - # -> next line is span[0] + 1 and not span[1] as for |
23 | | - # line eval directives |
24 | | - nextline = max(span[1], span[0] + 1) |
25 | | - trailing += self._linenumdir(nextline, fname) |
| 19 | ++ # For inline eval directives span[0] == span[1] |
| 20 | ++ # -> next line is span[0] + 1 and not span[1] as for |
| 21 | ++ # line eval directives |
| 22 | ++ nextline = max(span[1], span[0] + 1) |
| 23 | ++ trailing += self._linenumdir(nextline, fname) |
| 24 | + else: |
| 25 | + trailing = '' |
| 26 | + return result + trailing |
0 commit comments