Skip to content

Commit f85f7fa

Browse files
authored
fix: update fypp linemarker-resync patch header for fypp 3.2 (#1439)
1 parent 1139cc4 commit f85f7fa

1 file changed

Lines changed: 16 additions & 15 deletions

File tree

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,26 @@
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 @@
104
and not self._contlinenums)
115
# Eval directive in source consists of more than one line
126
multiline = span[1] - span[0] > 1
137
- 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)
1413
+ # Always emit a resync marker after a $: call. Without this,
1514
+ # single-line $: calls that expand to multi-line #if/#endif
1615
+ # blocks (e.g. GPU_PARALLEL_LOOP) cause the compiler to
1716
+ # attribute the next Fortran statement to the call-site line
1817
+ # rather than the following source line, producing off-by-1
1918
+ # 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

Comments
 (0)