def write_fortran(s): b = Buffer() b('module {:s} ! {:s}', s.module_guid, s.value) if s.value != fytbk.url: b += 'use ' + s.stack.fytbk.module_guid b += s.b if s.method_buffer.has_content: if not s.contains_used[0]: b += '\ncontains\n' s.contains_used[0] = 1 b += s.method_buffer if s.main.has_content: if not s.contains_used[0]: b += '\ncontains\n' b += 'subroutine {:s}_main()'.format(s.module_guid) b.indent if s.debug: b != tbk.init_frame(s.value, 'main') b *= s.main if s.debug: b != tbk.del_frame() b.dedent b += 'end subroutine' b += 'end module' source = s.write_guid(str(b)) open(s.url.fortran_path, 'w').write(source)
def tbk_eframe(s): if s.debug: if s.module.tbk_frame_rout[s.level] == 0: return tbk.del_frame() return ''
def tbk_eframe(s): if s.debug: return tbk.del_frame() else: return ''