Skip to content
Open
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
8 changes: 7 additions & 1 deletion bionetgen/modelapi/bngfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,14 @@ def strip_actions(self, model_path, folder) -> str:
return stripped_model

def _not_action(self, line) -> bool:
# Anchor the match to the start of the (left-stripped) line so that
# user identifiers containing an action name as a substring — most
# commonly ``conversion()`` (the substring ``version(`` matches the
# ``version`` action) inside a ``begin functions`` block — aren't
# misclassified and pulled out as actions.
stripped = line.lstrip()
for action in self._action_list:
if action in line:
if stripped.startswith(action):
return False
return True

Expand Down
Loading