pearu / f2py

Automatically exported from code.google.com/p/f2py
Other
54 stars 38 forks source link

Issue on comment line at the beginin of source files. #6

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I am not so sure whether you think it is worth to fix it or not.

What steps will reproduce the problem?
1.
--------------------------
C test ccc
      subroutine bndfp1()
      end

      subroutine bndfp2()
      end

--------------------------
2. parse it with fatest.py as Issue4.

What is the expected output? What do you see instead?
This is the result by r17.
print tree.content gives not clean block structure as
[        CommentBlock
          item=Comment('C test ccc',(1, 1)),         Subroutine
          item=Line('subroutine bndfp1()',(2, 2),'')
          content:
        EndSubroutine
          blocktype='subroutine'
          name='bndfp1'
          item=Line('end',(3, 4),''),         Subroutine
          item=Line('subroutine bndfp2()',(5, 5),'')
          content:
        EndSubroutine
          blocktype='subroutine'
          name='bndfp2'
          item=Line('end',(6, 6),'')]

What version of the product are you using? On what operating system?
r17

Please provide any additional information below.
The output of print tree.content looks a little ugly
 ("Subroutine" is end of lines).

Original issue reported on code.google.com by TakaoKot...@gmail.com on 8 Mar 2010 at 2:57

GoogleCodeExporter commented 9 years ago
This is not a bug. tree.content is a Python list and the way it is
printed cannot be changed.

However, to print tree with a clean block structure, you should use
{{{
  print tree.torepr(4)
}}}

Original comment by pearu.peterson on 8 Mar 2010 at 8:35

GoogleCodeExporter commented 9 years ago
Thank you so much for your kind reply.
I have to learn your fparser and also python itself.

I am not so familiar with the OO ideas.
I need to learn how to extract analyzed information 
from tree=parse(...

But anyway, I have an impression that your fparser works fine.
Thanks again.

Original comment by TakaoKot...@gmail.com on 9 Mar 2010 at 2:59