Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 5 additions & 11 deletions lfric_macros/apply_macros.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,9 @@ def split_macros(parsed_versions):
in_macro = False
in_comment = False
for line in parsed_versions:
if '"""' in line:
# If there is a comment marker in the line, check there aren't 2
for _ in range(line.count('"""')):
in_comment = not in_comment
if in_comment:
continue
if line.startswith("class vn"):
if line.startswith("class vn") and not line.startswith(
"class vnXX_txxx"
):
# If the macro string is set, then append to the list. If it's
# empty then this is the first macro we're looking at, so nothing to
# append
Expand Down Expand Up @@ -249,9 +245,7 @@ def set_rose_meta_path(self):
When Jules Shared from Jules is enabled, self.jules_source will need
adding here
"""
rose_meta_path = (
f"{self.root_path}:{self.core_source}"
)
rose_meta_path = f"{self.root_path}:{self.core_source}"
os.environ["ROSE_META_PATH"] = rose_meta_path

def parse_application_section(self, meta_dir):
Expand Down Expand Up @@ -441,7 +435,7 @@ def parse_macro(self, macro, meta_dir):
in_function = True
continue
if (
line_stripped.startswith("return")
line_stripped.startswith("return config, self.reports")
or line_stripped.startswith("# Input your macro commands here")
or line_stripped.lower().startswith("# add settings")
or not in_function
Expand Down