Skip to content

Commit

Permalink
Merge pull request #250 from cyrillemidingoyi/newb
Browse files Browse the repository at this point in the history
update
  • Loading branch information
cyrillemidingoyi authored Oct 24, 2024
2 parents b5b5a46 + f51b6c3 commit 488a7b0
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
22 changes: 15 additions & 7 deletions src/pycropml/transpiler/generators/simplaceGenerator.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,18 +117,25 @@ def visit_declaration(self, node):
self.write(" = ")
if n.type=="local":
self.write(n.value)
else: self.visit(n)
else: self.visit(n.value) if isinstance(n.value, Node) else self.write(n.value)
self.write(";")
elif 'elements' in dir(n) and n.type in ("list", "tuple"):
elif 'elements' in dir(n) and n.type in ("list", "tuple", "array"):
if n.type=="list":
self.visit_decl(n.pseudo_type)
self.write(n.name)
self.write(" = new ArrayList <>(Arrays.asList")
if n.type=='tuple':
self.write(u'(')
self.comma_separated_list(n.elements)
self.write(u'));')
elif n.type=='tuple':
pass
self.write(u'(')
self.comma_separated_list(n.elements)
self.write(u'));')
elif n.type=="array":
self.visit_decl(n.pseudo_type)
self.write(n.name)
self.write(" = ")
self.write(u'{')
self.comma_separated_list(n.elements)
self.write(u'};')
elif n.type=='datetime':
self.newline(node)
self.write("Date")
Expand Down Expand Up @@ -488,7 +495,8 @@ def addVar(self,node,elem):

if inp.datatype.startswith("DATE"): zmin, zmax,zdefault= "null", "null", "null"
self.write('addVariable(FWSimVariable.createSimVariable("%s", "%s", DATA_TYPE.%s, CONTENT_TYPE.%s,"%s", %s, %s, %s, this));'%(inp.name, inp.description,DATA_TYPE[inp.datatype],ztype,unit, zmin, zmax, zdefault))
self.newline(node)
self.newline(node)




Expand Down
2 changes: 1 addition & 1 deletion src/pycropml/transpiler/rules/rRules.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def __init__(self):
}

unary_op = {
'not': 'not ',
'not': '!',
'+': '+',
'-': '-',
'~': '~'
Expand Down

0 comments on commit 488a7b0

Please sign in to comment.