Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[StubGen] Fix code generation with default parameters #50

Merged
merged 2 commits into from
Oct 25, 2023
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
5 changes: 3 additions & 2 deletions ProxyStubGenerator/CppParser.py
Original file line number Diff line number Diff line change
Expand Up @@ -1118,7 +1118,8 @@ def __repr__(self):

class Parameter(Variable):
def __init__(self, parent_block, string, value=[], valid_specifiers=[]):
Variable.__init__(self, parent_block, string, value, valid_specifiers)
Variable.__init__(self, parent_block, string, None, valid_specifiers)
self.def_value = Evaluate(value) if value else None
if self.name in parent_block.retval.meta.param:
self.meta.brief = parent_block.retval.meta.param[self.name]

Expand All @@ -1129,7 +1130,7 @@ def __str__(self):
return "%s %s" % (self.Proto(), self.name)

def __repr__(self):
value = ValueStr(self.value) if self.value else None
value = ValueStr(self.def_value) if self.def_value else None
return "param %s '%s'%s" % (TypeStr(self.type), str(self.name), (" = " + value) if value else "")


Expand Down