# 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 os.path import abspath, join, dirname
import sys
"""
Test parsing of whole fortran files; 'blackbox' tests here.
"""
from __future__ import absolute_import
from __future__ import print_function


def test_use_module():
    d = dirname(__file__)
    sources = [join(d,'modfile.f95'), join(d,'funcfile.f95')]
    file_to_parse = sources[1]
    tree = api.parse(file_to_parse, isfree=True, isstrict=False, source_only = sources)

def test_dimension_attr():
    source_str = '''
    subroutine foo
    integer, dimension( -10 : 10, -   2147483648 : 2147483648) :: a( -2 : 2, 1000000 : 1000001 )
    real, dimension(-20:20, 100:113, -  512  : 713) :: 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_api.py
from fparser import api
from os.path import abspath, join, dirname
import sys

"""
Test parsing of whole fortran files; 'blackbox' tests here.
"""
from __future__ import absolute_import
from __future__ import print_function


def test_use_module():
    d = dirname(__file__)
    sources = [join(d,'modfile.f95'), join(d,'funcfile.f95')]
    file_to_parse = sources[1]
    tree = api.parse(file_to_parse, isfree=True, isstrict=False, source_only = sources)

def test_dimension_attr():
    source_str = '''
    subroutine foo
    integer, dimension( -10 : 10, -   2147483648 : 2147483648) :: a( -2 : 2, 1000000 : 1000001 )
    real, dimension(-20:20, 100:113, -  512  : 713) :: b
    end
    '''


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