Skip to content

Commit 21bd331

Browse files
committed
fix: preprocessor #else branch
preprocessor content of the #else branch is now included when the #if evaluates to false
1 parent 7f892ac commit 21bd331

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

fortls/parse_fortran.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2150,6 +2150,8 @@ def replace_vars(line: str):
21502150
exc_start = True
21512151
else:
21522152
pp_stack[-1][1] = i + 1
2153+
pp_skips.append(pp_stack.pop())
2154+
pp_stack.append([-1, -1])
21532155
inc_start = True
21542156
elif match.group(1) == "endif":
21552157
if pp_stack[-1][0] < 0:

0 commit comments

Comments
 (0)