Commit a5af14ac authored by Henning Glawe's avatar Henning Glawe
Browse files

evaluate kindStr/dtypeStr in AST_declaration.declaration_nomadmetainfo

parent 3f137294
......@@ -310,6 +310,29 @@ class AST_declaration(AST_node):
raise RuntimeError('already has shape: %s', self.name)
self.child[0] = shape
def declaration_nomadmetainfo(self, output_file, namespace):
thisname = namespace + '.' + self.name
kindStr = self.child[1].nomad_kindStr()
dtypeStr = self.child[1].nomad_dtypeStr()
output_file.write((
', {\n' +
' "description": "FPLO input %s",\n' +
' "name": "%s",\n' +
' "superNames": [ "%s" ]\n'
) % (thisname, thisname, namespace))
if kindStr is not None:
output_file.write(' "kindStr": "%s"\n' % (kindStr))
elif dtypeStr is not None:
output_file.write(' "dtypeStr": "%s"\n' % (dtypeStr))
else:
raise RuntimeError(
"neither kindStr nor dtypeStr are defined for %s" % (
thisname
)
)
output_file.write('}')
AST_node.declaration_nomadmetainfo(self, output_file, namespace)
class AST_shape(AST_node):
# children are ints without indented_str method
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment