Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reprinter deletes commentaries in multiline declaration #115

Open
foxtran opened this issue Jan 10, 2020 · 1 comment
Open

Reprinter deletes commentaries in multiline declaration #115

foxtran opened this issue Jan 10, 2020 · 1 comment

Comments

@foxtran
Copy link

foxtran commented Jan 10, 2020

I have tried to reprint the following code:

      program main
      integer, parameter :: &
      minimum = 10, & !< minimum
      maximum = 20    !< maximum
      end

and it produces the following output without any commentaries:

program main
  integer, parameter :: minimum = 10, maximum = 20
end program main

Is it possible to save commentaries in this context?

@madgen
Copy link
Member

madgen commented Jan 10, 2020

Yeah, we know about this. It was mentioned in #45. Basically, this is incredibly difficult in Fortran because you can write a comment in the middle of a keyword or an identifier as well. So it is not clear where to associate the comment in the AST.

That said there is a reprinting algo in camfort/camfort that doesn't touch the untransformed bits of the AST so they remain identical to the original source code. If that' what you need, that might be your best bet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants