# Path: fparser/api.py
# def get_reader(input, isfree=None, isstrict=None, include_dirs = None, source_only = None,
#                ignore_comments = True):
# def parse(input, isfree=None, isstrict=None, include_dirs = None, source_only = None,
#           ignore_comments = True, analyze=True):
# def walk(stmt, depth=-1, _initial_depth = None):


from fparser import api
from __future__ import absolute_import


def test_reproduce_issue_1():
    source_str = '''\
      subroutine bndfp(ax,i)
      logical:: ax
      if(ax) i=1
      end
'''
    tree = api.parse(source_str, isfree=False, isstrict=False,
                     ignore_comments=False)
    ifstmt = tree.content[0].content[1]
    assert str(ifstmt).strip()=='''
    IF (ax) i = 1'''.strip()

def test_reproduce_issue_2():
    source_str = '''\
      subroutine bndfp(ax,i)
      logical:: ax
      if(ax) call bb(a,b)
      end
'''

# Path: fparser/api.py
# def get_reader(input, isfree=None, isstrict=None, include_dirs = None, source_only = None,
#                ignore_comments = True):
# def parse(input, isfree=None, isstrict=None, include_dirs = None, source_only = None,
#           ignore_comments = True, analyze=True):
# def walk(stmt, depth=-1, _initial_depth = None):


# Path: fparser/tests/test_issue23.py
from fparser import api

from __future__ import absolute_import


def test_reproduce_issue_1():
    source_str = '''\
      subroutine bndfp(ax,i)
      logical:: ax
      if(ax) i=1
      end
'''
    tree = api.parse(source_str, isfree=False, isstrict=False,
                     ignore_comments=False)
    ifstmt = tree.content[0].content[1]
    assert str(ifstmt).strip()=='''
    IF (ax) i = 1'''.strip()

def test_reproduce_issue_2():
    source_str = '''\
      subroutine bndfp(ax,i)
      logical:: ax
      if(ax) call bb(a,b)
      end
'''

    tree = api.parse(source_str, isfree=False, isstrict=False,