split2 Function

private pure function split2(s, token) result(vals)

Split a string, given a token.

Arguments

Type IntentOptional Attributes Name
type(string), intent(in) :: s
character(len=*), intent(in) :: token

Return Value type(string), dimension(:), allocatable


Calls

proc~~split2~~CallsGraph proc~split2 aoc_utilities::split2 proc~split1 aoc_utilities::split1 proc~split2->proc~split1 proc~expand_vector aoc_utilities::expand_vector proc~split1->proc~expand_vector

Called by

proc~~split2~~CalledByGraph proc~split2 aoc_utilities::split2 interface~split aoc_utilities::split interface~split->proc~split2 proc~go~2 problem_18::go proc~go~2->interface~split proc~go~8 problem_12::go proc~go~8->interface~split proc~initialize problem_22::initialize proc~initialize->interface~split proc~parse_nums64 aoc_utilities::parse_nums64 proc~parse_nums64->interface~split proc~parse_rule problem_19::parse_rule proc~parse_rule->interface~split proc~parse_rule~2 problem_19b::parse_rule proc~parse_rule~2->interface~split program~problem_12b problem_12b program~problem_12b->interface~split program~problem_15 problem_15 program~problem_15->interface~split program~problem_19 problem_19 program~problem_19->interface~split program~problem_19->proc~parse_rule program~problem_19b problem_19b program~problem_19b->interface~split program~problem_19b->proc~parse_rule~2 program~problem_2 problem_2 program~problem_2->interface~split program~problem_25 problem_25 program~problem_25->interface~split program~problem_4 problem_4 program~problem_4->interface~split program~problem_7 problem_7 program~problem_7->interface~split interface~parse aoc_utilities::parse interface~parse->proc~parse_nums64 program~problem_12 problem_12 program~problem_12->proc~go~8 program~problem_18 problem_18 program~problem_18->proc~go~2 program~problem_22 problem_22 program~problem_22->proc~initialize program~problem_9 problem_9 program~problem_9->interface~parse

Source Code

    pure function split2(s,token) result(vals)

    implicit none

    type(string),intent(in)  :: s
    character(len=*),intent(in)  :: token
    type(string),dimension(:),allocatable:: vals

    if (allocated(s%str)) then
        vals = split1(s%str,token)
    else
        error stop 'error: string not allocated'
    end if

    end function split2