fdoc

functioninclude_nameprivate

logical function include_name(line, name)

True if line is an include line, returning the file it names.

Arguments

NameTypeIntentAttributesDescription
linecharacter(len=*)in

the line

namecharacter(len=:)outallocatable

the file named

Result

NameTypeAttributesDescription
include_namelogical

Calls

Source

Show the code
logical function include_name(line, name)
    character(len=*), intent(in) :: line                !! the line
    character(len=:), allocatable, intent(out) :: name  !! the file named
    character(len=:), allocatable :: code
    integer :: last

    include_name = .false.
    code = strip(line)
    if (len(code) < 10) return
    if (lowercase(code(1:8)) /= 'include ') return
    code = strip(code(9:))
    if (code(1:1) /= '"' .and. code(1:1) /= "'") return
    last = index(code(2:), code(1:1))
    if (last == 0) return
    name = code(2:last)
    include_name = .true.
end function include_name

Graphs

Calls

Called by