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

In-line comments not working #3

Open
nravicha opened this issue Dec 27, 2015 · 2 comments
Open

In-line comments not working #3

nravicha opened this issue Dec 27, 2015 · 2 comments

Comments

@nravicha
Copy link

Hi everyone,

I am trying to use sphinx-fortran to autodoc my fortran code. I am able to get it autodoc comments under programs, modules, functions, subroutines and types but I am unable to get the in-line comments for variables into the documentation. For eg.,

integer, parameter :: dp=kind(1.0d0) ! real*8 type

doesn't produce the comment "real*8 type" under the variable "dp" in the documentation. Am I doing something wrong? Or is this a bug with sphinx-fortran extension?

Thanks,
-Navaneeth

@tgastine
Copy link

tgastine commented Jan 5, 2016

Hi,

This is indeed an issue I also found. It works fine as long as there's no digit in the declaration of the parameter. I suppose it should be easy to fix the regexp...

Thomas

@mwilmer
Copy link

mwilmer commented Jan 10, 2016

Hey,

I did some runs on the regexp used to grab the comment and on your line. The "." used in the kind declaration seems to be causing the problem. Adding it to the regexp should solve the problem. I used the following:

r'[\W\(\),\b\*=\-\&]*?:?:[ \t\&]*(?P<varname>%s)\b[\w\s\(\)\*,_=\.]*!\s*(?P<vardesc>.*)'%'|'.join(block['sortvars'])

the addition of the "." in the []-block makes your declaration valid.

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

3 participants