We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 1f54125 + 325b821 commit a3a0f07Copy full SHA for a3a0f07
fortls/parse_fortran.py
@@ -2234,6 +2234,10 @@ def replace_vars(line: str):
2234
2235
# Substitute (if any) read in preprocessor macros
2236
for def_tmp, value in defs_tmp.items():
2237
+ # Skip if the line does not contain the macro at all. This is supposed to
2238
+ # spare the expensive regex-substitution in case we do not need it at all
2239
+ if def_tmp not in line:
2240
+ continue
2241
def_regex = def_regexes.get(def_tmp)
2242
if def_regex is None:
2243
def_regex = re.compile(rf"\b{def_tmp}\b")
0 commit comments