Skip to content

Commit

Permalink
Merge pull request #248 from TeikiRaihauti/master
Browse files Browse the repository at this point in the history
modify the assignment for list in c#
  • Loading branch information
pradal authored Oct 24, 2024
2 parents 71e398f + dbcbc47 commit b5b5a46
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/pycropml/transpiler/generators/csharpGenerator.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,9 +278,11 @@ def visit_assignment(self, node):
else:
if node.target.type=="index" and node.target.sequence.pseudo_type[0]=="list":
self.visit(node.target.sequence)
self.write(".Add(")
self.write("[")
self.visit(node.target.index)
self.write("]=")
self.visit(node.value)
self.write(");")
self.write(";")

elif node.value.type == "standard_call" and node.value.function=="integr":
self.write("%s = new List<%s>(%s);"%(node.target.name,self.types[node.target.pseudo_type[1]], node.value.args[0].name))
Expand Down

0 comments on commit b5b5a46

Please sign in to comment.