pearu / f2py

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

Bugs in If class? Related to Isssue21. #23

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I have two points. I have simplified problems.

(1) For a program,
-----------------------------------
      subroutine bndfp(ax,i)
      logical:: ax
      if(ax) i=1
      end  
-----------------------------------
Your parse in api.py classify 'if(ax)i' as a variable.
---------------------------------------------------
  Subroutine
    args=['ax', 'i']
    item=Line('subroutine bndfp(ax,i)',(2, 2),None,None,<reader>)
    a=AttributeHolder:
variables=<dict with keys ['i', 'ax']>
    content:
      Logical
        selector=('', '')
        entity_decls=['ax']
        item=Line('logical:: ax',(3, 3),None,None,<reader>)
      Assignment
        variable='if(ax)i'
        sign='='
        expr='1'
        item=Line('if(ax) i=1',(4, 4),None,None,<reader>)
  EndSubroutine
    blocktype='subroutine'
    name='bndfp'
    item=Line('end',(5, 5),None,None,<reader>)
---------------------------------------------------

(2) For a program,
-----------------------------------
      subroutine bndfp(ax,i)
      logical:: ax
      if(ax) call bb()
      end  
-----------------------------------
Your parse in api.py shows
-----------------------------------
If
  blocktype='if'
  name='__IF__'
  item=Line('if(ax) call bb()',(3, 3),None,None,<reader>)
  content:
    Call
      item=Line('call bb()',(3, 3),None,None,<reader>)
-----------------------------------
. This is a little problematic because 'call bb()'
is contained in both of Line. I think  'call bb()' should
not be contained in the If instance.
(it is the same as if then block...).

takao

Original issue reported on code.google.com by TakaoKot...@gmail.com on 14 May 2010 at 4:13

GoogleCodeExporter commented 8 years ago
This issue was closed by revision d70c2d0851.

Original comment by pearu.peterson on 28 Jul 2010 at 8:05