Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
nomad-lab
parser-fplo
Commits
a5af14ac
Commit
a5af14ac
authored
Nov 06, 2016
by
Henning Glawe
Browse files
evaluate kindStr/dtypeStr in AST_declaration.declaration_nomadmetainfo
parent
3f137294
Changes
1
Hide whitespace changes
Inline
Side-by-side
parser/parser-fplo/FploInputParser.py
View file @
a5af14ac
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment