Skip to content
Snippets Groups Projects
Commit c4266bac authored by Karl-Hermann Wieners's avatar Karl-Hermann Wieners
Browse files

Changed formatting of example key assignments to use Fortran syntax

parent 6f72c68a
No related branches found
No related tags found
No related merge requests found
......@@ -167,9 +167,14 @@ def format_namelist(section):
lines.write(' '*base_indent+key+' = '+
format_value(value, indent)+line+'\n')
for line in section.comments.get(group, []):
if line and re.match(r'#\s*\w+\s*=', line):
lines.write(' '*base_indent+
re.sub(r'^#', '!', line)+'\n')
if line:
match = re.match(r'#\s*(\w+)\s*=\s*(.*?)\s*$', line)
if match:
key = match.group(1)
value = match.group(2)
indent = base_indent + 2 + len(key) + 3
lines.write(' '*base_indent+'! '+key+' = '+
format_value(value, indent)+'\n')
lines.write('/\n')
return lines.getvalue()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment