Skip to content

Commit

Permalink
[Stubgen] Enhance enum evaluating (#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
sebaszm authored Aug 4, 2023
1 parent b4fe9f5 commit 6a267cd
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ProxyStubGenerator/CppParser.py
Original file line number Diff line number Diff line change
Expand Up @@ -658,6 +658,11 @@ def __Search(tree, found, T):
for e in tree.enums:
enumerator_match += [item for item in e.items if item.full_name.endswith(T)]

# non-scoped enums can also be called with scope
if not e.scoped:
enumerator_match += [item for item in e.items if item.full_name_scoped.endswith(T)]


template_match = []
if (isinstance(tree, TemplateClass)):
template_match = [t for t in tree.arguments if t.full_name.endswith(T)]
Expand Down Expand Up @@ -1244,6 +1249,7 @@ def __init__(self, parent_block, name, value=None, type=["int"]):
if isinstance(self.value, (int)):
self.parent.SetValue(self.value)
self.parent.items.append(self)
self.full_name_scoped = parent_block.full_name + "::" + self.name

def Proto(self):
return self.full_name
Expand Down

0 comments on commit 6a267cd

Please sign in to comment.