Skip to content

Commit

Permalink
Merge pull request #1087 from lf-lang/python-bank-index-fix
Browse files Browse the repository at this point in the history
Fixed an issue with bank_index
  • Loading branch information
housengw authored Apr 11, 2022
2 parents e5e988a + 7dd5d2e commit 794fabc
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,10 @@ private static String generatePythonClassInstantiation(ReactorInstance instance,
CodeBuilder code = new CodeBuilder();
code.pr(PyUtil.reactorRef(instance)+" = _"+className+"(");
code.indent();
// Always add the bank_index
code.pr("_bank_index = "+PyUtil.bankIndex(instance)+",");
for (ParameterInstance param : instance.parameters) {
if (param.getName().equals("bank_index")) {
code.pr("_bank_index = "+PyUtil.bankIndex(instance)+",");
} else {
if (!param.getName().equals("bank_index")) {
code.pr("_"+param.getName()+"="+PythonParameterGenerator.generatePythonInitializer(param)+",");
}
}
Expand Down

0 comments on commit 794fabc

Please # to comment.