Skip to content

Commit

Permalink
Fixed a bug where DOM elements inside preprocessor conditionals didn'…
Browse files Browse the repository at this point in the history
…t get enumerated under some circumstances
  • Loading branch information
ShironekoBen committed Oct 14, 2023
1 parent d626eb1 commit db0799f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions docs/Changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
* Standardised the rule that "metadata elements are omitted if not known" and removed cases where they were omitted
when not their default values. (#42)
* Made the JSON generator include #defines with no actual value (#43)
* Fixed a bug where DOM elements inside preprocessor conditionals didn't get enumerated under some circumstances

--- v0.06

Expand Down
4 changes: 2 additions & 2 deletions src/code_dom/element.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ def __attach_unmodified_clones(self, clone):
child.__attach_unmodified_clones(clone_child)

# Is this element a preprocessor container (#if or similar)?
def __is_preprocessor_container(self):
def is_preprocessor_container(self):
return False

# Get a list of the directly contained children of this element - this means all immediate children and
Expand All @@ -370,7 +370,7 @@ def list_directly_contained_children(self):
result = []
for child_list in self.get_child_lists():
for child in child_list:
if child.__is_preprocessor_container():
if child.is_preprocessor_container():
# Recurse into preprocessor containers
for container_child in child.list_directly_contained_children():
result.append(container_child)
Expand Down
2 changes: 1 addition & 1 deletion src/code_dom/preprocessorif.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ def remove_child_from_else(self, child):
self.else_children.remove(child)
child.parent = None

def __is_preprocessor_container(self):
def is_preprocessor_container(self):
return True

def get_child_lists(self):
Expand Down

0 comments on commit db0799f

Please sign in to comment.