Skip to content

Commit 10dc58f

Browse files
committed
fix: preprocessor #elif no longer skips whole file
When an #elif branch evaluates to true, after the next #endif the rest of the whole files #define, #undef and #include statements would not be parsed. Now those are correctly parsed.
1 parent faf6d7e commit 10dc58f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

fortls/parse_fortran.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2142,6 +2142,7 @@ def replace_vars(line: str):
21422142
else:
21432143
if eval_pp_if(line[match.end(1) :], defs_tmp):
21442144
pp_stack[-1][1] = i - 1
2145+
pp_skips.append(pp_stack.pop())
21452146
pp_stack.append([-1, -1])
21462147
inc_start = True
21472148
elif match.group(1) == "else":

0 commit comments

Comments
 (0)