fortran-lang / fprettify

auto-formatter for modern fortran source code
https://pypi.python.org/pypi/fprettify
Other
370 stars 76 forks source link

Problem with code-like string in comment #36

Closed kostyfisik closed 5 years ago

kostyfisik commented 5 years ago

A comment in file

*  n(silica)=1.45  <--->    EPS(1)=2.1025D0
*  n(ZnS)=2.       <--->    EPS(1)=4.D0

lead to an error

$ fprettify chew_rad.f
ERROR: File chew_rad.f, line 193
    Fatal error occured
Traceback (most recent call last):
  File "/home/tig/.local/lib/python2.7/site-packages/fprettify/__init__.py", line 1417, in run
    strip_comments=args.strip_comments)
  File "/home/tig/.local/lib/python2.7/site-packages/fprettify/__init__.py", line 908, in reformat_inplace
    orig_filename=filename, **kwargs)
  File "/home/tig/.local/lib/python2.7/site-packages/fprettify/__init__.py", line 1015, in reformat_ffile
    stream.line_nr, manual_lines_indent)
  File "/home/tig/.local/lib/python2.7/site-packages/fprettify/__init__.py", line 335, in process_lines_of_fline
    f_line, lines, rel_ind_con, line_nr)
  File "/home/tig/.local/lib/python2.7/site-packages/fprettify/__init__.py", line 433, in process_lines_of_fline
    line, is_decl, rel_ind, self._line_nr + pos)
  File "/home/tig/.local/lib/python2.7/site-packages/fprettify/__init__.py", line 516, in __align_line_continuations
    "found more than one assignment in the same Fortran line", filename, line_nr)
FprettifyInternalException: found more than one assignment in the same Fortran line
pseewald commented 5 years ago

You are using Fortran 77 syntax for comments but fprettify can only deal with modern Fortran (Fortran 90 and upwards).