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

DOC comments from recursive subroutines are not read #7

Open
ostueker opened this issue Oct 19, 2016 · 0 comments
Open

DOC comments from recursive subroutines are not read #7

ostueker opened this issue Oct 19, 2016 · 0 comments

Comments

@ostueker
Copy link

ostueker commented Oct 19, 2016

I was just playing around with sphinx-python (version 1.0.1) and noticed that the header and inline comments are not extracted when the recursive keyword precedes a subroutine.

Example:

With this Fortran Code:

recursive SUBROUTINE add_tree_node(current, value)
! Add new tree_node into the tree.

    TYPE (tree_node), pointer :: current ! pointer to current tree
    REAL :: value                        ! value of new tree node

    IF (.NOT.associated(current)) THEN
        allocate(current)
        current%value = value
    ELSEIF (value < current%value) THEN
        CALL add_tree_node(current%left, value)
    ELSE
        CALL add_tree_node(current%right, value)
    END IF
END SUBROUTINE add_tree_node

and sphinx-fortran directive: .. f:autosrcfile:: tree_sort_module.f90

I get this after generating with make text:

subroutine  tree_sort_module/add_tree_node(current, value)

   Parameters:
      * **current*** [**tree_node**,**pointer**]*

      * **value*** [**real**]*

   Called from:
      "tree_sort"

Once I remove the recursive keyword, the comments get properly included in the docs:

subroutine  tree_sort_module/add_tree_node(current, value)

   Add new tree_node into the tree.

   Parameters:
      * **current*** [**tree_node**,**pointer**]* :: pointer to
        current tree

      * **value*** [**real**]* :: value of new tree node

   Called from:
      "add_tree_node()", "tree_sort"

   Call to:
      "add_tree_node()"
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

1 participant